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
08ce94e3
Commit
08ce94e3
authored
Jun 29, 2001
by
Evan Simpson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Incorporated changes to security machinery for Zope 2.4
parent
82035aa4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
4 deletions
+6
-4
lib/python/Products/PageTemplates/CHANGES.txt
lib/python/Products/PageTemplates/CHANGES.txt
+1
-0
lib/python/Products/PageTemplates/ZRPythonExpr.py
lib/python/Products/PageTemplates/ZRPythonExpr.py
+5
-4
No files found.
lib/python/Products/PageTemplates/CHANGES.txt
View file @
08ce94e3
...
@@ -15,3 +15,4 @@ Page Template changes
...
@@ -15,3 +15,4 @@ Page Template changes
Bugs Fixed
Bugs Fixed
- The various *Python modules failed to import CompilerError.
- The various *Python modules failed to import CompilerError.
- Security machinery changes in Zope 2.4 broke ZRPythonExpr
lib/python/Products/PageTemplates/ZRPythonExpr.py
View file @
08ce94e3
...
@@ -88,10 +88,11 @@
...
@@ -88,10 +88,11 @@
Handler for Python expressions that uses the RestrictedPython package.
Handler for Python expressions that uses the RestrictedPython package.
"""
"""
__version__
=
'$Revision: 1.
4
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.
5
$'
[
11
:
-
2
]
from
AccessControl
import
full_read_guard
,
full_write_guard
,
\
from
AccessControl
import
full_read_guard
,
full_write_guard
,
\
safe_builtins
,
getSecurityManager
safe_builtins
,
getSecurityManager
from
AccessControl.ZopeGuards
import
guarded_getattr
,
guarded_getitem
from
RestrictedPython
import
compile_restricted_eval
from
RestrictedPython
import
compile_restricted_eval
from
TALES
import
CompilerError
from
TALES
import
CompilerError
from
string
import
strip
,
split
,
join
,
replace
,
lstrip
from
string
import
strip
,
split
,
join
,
replace
,
lstrip
...
@@ -101,8 +102,8 @@ from PythonExpr import PythonExpr
...
@@ -101,8 +102,8 @@ from PythonExpr import PythonExpr
class
PythonExpr
(
PythonExpr
):
class
PythonExpr
(
PythonExpr
):
_globals
=
{
'__debug__'
:
__debug__
,
_globals
=
{
'__debug__'
:
__debug__
,
'__builtins__'
:
safe_builtins
,
'__builtins__'
:
safe_builtins
,
'_
read_'
:
full_read_guard
,
'_
getattr_'
:
guarded_getattr
,
'_
write_'
:
full_write_guard
,}
'_
getitem_'
:
guarded_getitem
,}
def
__init__
(
self
,
name
,
expr
,
engine
):
def
__init__
(
self
,
name
,
expr
,
engine
):
self
.
expr
=
expr
=
replace
(
strip
(
expr
),
'
\
n
'
,
' '
)
self
.
expr
=
expr
=
replace
(
strip
(
expr
),
'
\
n
'
,
' '
)
code
,
err
,
warn
,
use
=
compile_restricted_eval
(
expr
,
str
(
self
))
code
,
err
,
warn
,
use
=
compile_restricted_eval
(
expr
,
str
(
self
))
...
@@ -133,7 +134,7 @@ def call_with_ns(f, ns, arg=1):
...
@@ -133,7 +134,7 @@ def call_with_ns(f, ns, arg=1):
td
=
TemplateDict
()
td
=
TemplateDict
()
td
.
this
=
None
td
.
this
=
None
td
.
_push
(
ns
[
'request'
])
td
.
_push
(
ns
[
'request'
])
td
.
_push
(
InstanceDict
(
ns
[
'here'
],
td
,
full_read_guard
))
td
.
_push
(
InstanceDict
(
ns
[
'here'
],
td
,
guarded_getattr
))
td
.
_push
(
ns
)
td
.
_push
(
ns
)
try
:
try
:
if
arg
==
2
:
if
arg
==
2
:
...
...
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