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
7396bf14
Commit
7396bf14
authored
Nov 30, 2009
by
Tres Seaver
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
LP #490514: preserve tainting when calling into DTML from ZPT.
parent
815f006f
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
0 deletions
+17
-0
doc/CHANGES.rst
doc/CHANGES.rst
+3
-0
src/Products/PageTemplates/ZRPythonExpr.py
src/Products/PageTemplates/ZRPythonExpr.py
+2
-0
src/Products/PageTemplates/tests/testZRPythonExpr.py
src/Products/PageTemplates/tests/testZRPythonExpr.py
+12
-0
No files found.
doc/CHANGES.rst
View file @
7396bf14
...
...
@@ -27,9 +27,12 @@ Features Added
Bugs Fixed
++++++++++
- LP #490514: preserve tainting when calling into DTML from ZPT.
- Avoid possible errors on test tear-down in Products.Five.fiveconfigure's
cleanUp() function if Products.meta_types has not been set
Zope 2.12.1 (2009/11/02)
------------------------
...
...
src/Products/PageTemplates/ZRPythonExpr.py
View file @
7396bf14
...
...
@@ -69,6 +69,8 @@ def call_with_ns(f, ns, arg=1):
this
=
ns
.
get
(
'context'
,
ns
.
get
(
'here'
))
td
.
this
=
this
request
=
ns
.
get
(
'request'
,
{})
if
hasattr
(
request
,
'taintWrapper'
):
request
=
request
.
taintWrapper
()
td
.
_push
(
request
)
td
.
_push
(
InstanceDict
(
td
.
this
,
td
))
td
.
_push
(
ns
)
...
...
src/Products/PageTemplates/tests/testZRPythonExpr.py
View file @
7396bf14
...
...
@@ -40,6 +40,18 @@ class MiscTests(unittest.TestCase):
result
=
call_with_ns
(
_find_request
,
names
)
self
.
assertEqual
(
result
,
{})
def
test_call_with_request_preserves_tainting
(
self
):
from
Products.PageTemplates.ZRPythonExpr
import
call_with_ns
class
Request
(
dict
):
def
taintWrapper
(
self
):
return
{
'tainted'
:
'found'
}
context
=
[
'context'
]
here
=
[
'here'
]
names
=
{
'context'
:
context
,
'here'
:
here
,
'request'
:
Request
()}
found
=
call_with_ns
(
lambda
td
:
td
[
'tainted'
],
names
)
self
.
assertEqual
(
found
,
'found'
)
def
test_suite
():
return
unittest
.
makeSuite
(
MiscTests
)
...
...
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