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
e728c7b5
Commit
e728c7b5
authored
Feb 23, 2012
by
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- fixed a traversal regression
parent
1dd4c839
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
2 deletions
+14
-2
doc/CHANGES.rst
doc/CHANGES.rst
+1
-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.
doc/CHANGES.rst
View file @
e728c7b5
...
...
@@ -8,7 +8,7 @@ http://docs.zope.org/zope2/releases/.
2.13.14 (unreleased)
--------------------
- ZPublisher: Fixed a traversal regression introduced in 2.13.12.
2.13.13 (2012-02-20)
--------------------
...
...
src/ZPublisher/BaseRequest.py
View file @
e728c7b5
...
...
@@ -540,7 +540,7 @@ class BaseRequest:
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
)
...
...
src/ZPublisher/tests/testBaseRequest.py
View file @
e728c7b5
...
...
@@ -73,6 +73,9 @@ class BaseRequest_factory:
# Attribute without docstring.
return
'unpublishable'
def
__contains__
(
self
,
name
):
return
False
return
DummyObjectBasic
def
_makeBasicObject
(
self
):
...
...
@@ -194,6 +197,15 @@ class TestBaseRequest(unittest.TestCase, BaseRequest_factory):
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
())
...
...
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