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,18 +186,18 @@ 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)
if restricted and not validate(
obj, obj, name, next):
raise Unauthorized(name)
except TraversalError:
raise AttributeError(name)
try:
next = namespaceLookup(
ns, nm, obj, self.REQUEST).__of__(obj)
if restricted and not validate(
obj, obj, name, next):
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'
......@@ -378,7 +379,11 @@ class TestTraverse( unittest.TestCase ):
self.failUnless(
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