Commit 8bf9bc2d authored by Andreas Jung's avatar Andreas Jung

- Collector #2352: fix in OFS.Traversable

parent a046edbe
......@@ -8,6 +8,8 @@ Zope Changes
Bugs fixed
- Collector #2352: fix in OFS.Traversable
- Collector #2346: username logging in FCGI crashed the server
- ZopePageTemplate's pt_edit did not recognize content type arguments
......
......@@ -186,10 +186,9 @@ class Traversable:
bobo_traverse = getattr(obj, '__bobo_traverse__', None)
try:
if name and name[:1] in '@+' and name != '+':
if name and name[:1] in '@+' and name != '+' and nsParse(name)[1]:
# Process URI segment parameters.
ns, nm = nsParse(name)
if ns:
try:
next = namespaceLookup(
ns, nm, obj, self.REQUEST).__of__(obj)
......@@ -198,6 +197,7 @@ class Traversable:
raise Unauthorized(name)
except TraversalError:
raise AttributeError(name)
elif bobo_traverse is not None:
next = bobo_traverse(REQUEST, name)
if restricted:
......
......@@ -169,6 +169,7 @@ class TestTraverse( unittest.TestCase ):
self.app = makerequest( self.root, stdout=responseOut )
manage_addFolder( self.app, 'folder1' )
folder1 = getattr( self.app, 'folder1' )
setattr(folder1, '+something', 'plus')
folder1.all_meta_types = \
( { 'name' : 'File'
......@@ -379,6 +380,10 @@ class TestTraverse( unittest.TestCase ):
aq_base(self.root.folder1.file.restrictedTraverse('../..')) is
aq_base(self.root))
def testTraverseToNameStartingWithPlus(self):
# Verify it's possible to traverse to a name such as +something
self.failUnless(
self.folder1.unrestrictedTraverse('+something') is 'plus')
import os, sys
if __name__ == '__main__':
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment