Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
Zope
Commits
1fe09357
Commit
1fe09357
authored
Feb 23, 2012
by
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- fixed a traversal regression
parent
5d03ec13
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
1 deletion
+13
-1
src/ZPublisher/BaseRequest.py
src/ZPublisher/BaseRequest.py
+1
-1
src/ZPublisher/tests/testBaseRequest.py
src/ZPublisher/tests/testBaseRequest.py
+12
-0
No files found.
src/ZPublisher/BaseRequest.py
View file @
1fe09357
...
@@ -540,7 +540,7 @@ class BaseRequest:
...
@@ -540,7 +540,7 @@ class BaseRequest:
if
(
no_acquire_flag
and
if
(
no_acquire_flag
and
hasattr
(
parents
[
1
],
'aq_base'
)
and
hasattr
(
parents
[
1
],
'aq_base'
)
and
not
hasattr
(
parents
[
1
],
'__bobo_traverse__'
)):
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
):
if
not
(
hasattr
(
base
,
entry_name
)
or
entry_name
in
base
):
raise
AttributeError
(
entry_name
)
raise
AttributeError
(
entry_name
)
...
...
src/ZPublisher/tests/testBaseRequest.py
View file @
1fe09357
...
@@ -73,6 +73,9 @@ class BaseRequest_factory:
...
@@ -73,6 +73,9 @@ class BaseRequest_factory:
# Attribute without docstring.
# Attribute without docstring.
return
'unpublishable'
return
'unpublishable'
def
__contains__
(
self
,
name
):
return
False
return
DummyObjectBasic
return
DummyObjectBasic
def
_makeBasicObject
(
self
):
def
_makeBasicObject
(
self
):
...
@@ -194,6 +197,15 @@ class TestBaseRequest(unittest.TestCase, BaseRequest_factory):
...
@@ -194,6 +197,15 @@ class TestBaseRequest(unittest.TestCase, BaseRequest_factory):
self
.
assertEqual
(
r
.
URL
,
'/folder/objBasic'
)
self
.
assertEqual
(
r
.
URL
,
'/folder/objBasic'
)
self
.
assertEqual
(
r
.
response
.
base
,
''
)
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
):
def
test_traverse_withDefault
(
self
):
root
,
folder
=
self
.
_makeRootAndFolder
()
root
,
folder
=
self
.
_makeRootAndFolder
()
folder
.
_setObject
(
'objWithDefault'
,
self
.
_makeObjectWithDefault
())
folder
.
_setObject
(
'objWithDefault'
,
self
.
_makeObjectWithDefault
())
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment