[Zope-Checkins] CVS: Zope/lib/python/OFS - DTMLMethod.py:1.67.2.4

Matthew T. Kromer matt@zope.com
Fri, 2 Nov 2001 11:01:29 -0500


Update of /cvs-repository/Zope/lib/python/OFS
In directory cvs.zope.org:/tmp/cvs-serv22103

Modified Files:
      Tag: Zope-2_4-branch
	DTMLMethod.py 
Log Message:
Updated the DTML recursion security update with Steve Alexander's patch


=== Zope/lib/python/OFS/DTMLMethod.py 1.67.2.3 => 1.67.2.4 ===
         security=getSecurityManager()
         security.addContext(self)
-        self.__dict__['validate'] = security.DTMLValidate
+        if self.__dict__.has_key('validate'):
+            first_time_through = 0
+        else:
+            self.__dict__['validate'] = security.DTMLValidate
+            first_time_through = 1
         try:
         
             if client is None:
@@ -200,8 +204,8 @@
 
         finally:
             security.removeContext(self)
-            try: del self.__dict__['validate']
-            except: pass
+            if first_time_through:
+                del self.__dict__['validate']
 
         have_key=RESPONSE.headers.has_key
         if not (have_key('content-type') or have_key('Content-Type')):