Log message for revision 124461:
  - fixed a traversal regression

Changed:
  U   Zope/branches/2.13/doc/CHANGES.rst
  UU  Zope/branches/2.13/src/ZPublisher/BaseRequest.py
  UU  Zope/branches/2.13/src/ZPublisher/tests/testBaseRequest.py

-=-
Modified: Zope/branches/2.13/doc/CHANGES.rst
===================================================================
--- Zope/branches/2.13/doc/CHANGES.rst  2012-02-22 16:39:38 UTC (rev 124460)
+++ Zope/branches/2.13/doc/CHANGES.rst  2012-02-23 08:36:31 UTC (rev 124461)
@@ -8,8 +8,8 @@
 2.13.14 (unreleased)
 --------------------
 
+- ZPublisher: Fixed a traversal regression introduced in 2.13.12.
 
-
 2.13.13 (2012-02-20)
 --------------------
 

Modified: Zope/branches/2.13/src/ZPublisher/BaseRequest.py
===================================================================
--- Zope/branches/2.13/src/ZPublisher/BaseRequest.py    2012-02-22 16:39:38 UTC 
(rev 124460)
+++ Zope/branches/2.13/src/ZPublisher/BaseRequest.py    2012-02-23 08:36:31 UTC 
(rev 124461)
@@ -540,7 +540,7 @@
         if (no_acquire_flag and
             hasattr(parents[1], 'aq_base') and
             not hasattr(parents[1],'__bobo_traverse__')):
-            base = parents[-1].aq_base
+            base = parents[1].aq_base
             if not (hasattr(base, entry_name) or entry_name in base):
                 raise AttributeError(entry_name)
 


Property changes on: Zope/branches/2.13/src/ZPublisher/BaseRequest.py
___________________________________________________________________
Deleted: svn:keywords
   - Id

Modified: Zope/branches/2.13/src/ZPublisher/tests/testBaseRequest.py
===================================================================
--- Zope/branches/2.13/src/ZPublisher/tests/testBaseRequest.py  2012-02-22 
16:39:38 UTC (rev 124460)
+++ Zope/branches/2.13/src/ZPublisher/tests/testBaseRequest.py  2012-02-23 
08:36:31 UTC (rev 124461)
@@ -73,6 +73,9 @@
                 # Attribute without docstring.
                 return 'unpublishable'
 
+            def __contains__(self, name):
+                return False
+
         return DummyObjectBasic
 
     def _makeBasicObject(self):
@@ -194,6 +197,15 @@
         self.assertEqual(r.URL, '/folder/objBasic')
         self.assertEqual(r.response.base, '')
 
+    def test_traverse_basic_no_acquire_flag(self):
+        root, folder = self._makeRootAndFolder()
+        folder._setObject('objBasic', self._makeBasicObject())
+        r = self._makeOne(root)
+        r['REQUEST_METHOD'] = 'HEAD'
+        r.traverse('folder/objBasic')
+        self.assertEqual(r.URL, '/folder/objBasic')
+        self.assertEqual(r.response.base, '')
+
     def test_traverse_withDefault(self):
         root, folder = self._makeRootAndFolder()
         folder._setObject('objWithDefault', self._makeObjectWithDefault())


Property changes on: Zope/branches/2.13/src/ZPublisher/tests/testBaseRequest.py
___________________________________________________________________
Deleted: svn:keywords
   - Id

_______________________________________________
Zope-Checkins maillist  -  Zope-Checkins@zope.org
https://mail.zope.org/mailman/listinfo/zope-checkins

Reply via email to