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
cfdca86c
Commit
cfdca86c
authored
Jul 27, 2007
by
Philipp von Weitershausen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Sanitize root/request lookup
parent
8fb2bbd2
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
13 deletions
+7
-13
lib/python/Products/Five/browser/pagetemplatefile.py
lib/python/Products/Five/browser/pagetemplatefile.py
+7
-13
No files found.
lib/python/Products/Five/browser/pagetemplatefile.py
View file @
cfdca86c
...
@@ -17,7 +17,7 @@ $Id$
...
@@ -17,7 +17,7 @@ $Id$
"""
"""
import
os
,
sys
import
os
,
sys
from
Acquisition
import
aq_inner
from
Acquisition
import
aq_inner
,
aq_acquire
from
Globals
import
package_home
from
Globals
import
package_home
from
Products.PageTemplates.PageTemplateFile
import
PageTemplateFile
from
Products.PageTemplates.PageTemplateFile
import
PageTemplateFile
from
Products.PageTemplates.Expressions
import
SecureModuleImporter
from
Products.PageTemplates.Expressions
import
SecureModuleImporter
...
@@ -64,22 +64,16 @@ class ZopeTwoPageTemplateFile(PageTemplateFile):
...
@@ -64,22 +64,16 @@ class ZopeTwoPageTemplateFile(PageTemplateFile):
def
pt_getContext
(
self
):
def
pt_getContext
(
self
):
try
:
try
:
root
=
self
.
getPhysicalRoot
()
root
=
aq_acquire
(
self
.
context
,
'getPhysicalRoot'
)()
except
AttributeError
:
try
:
root
=
self
.
context
.
getPhysicalRoot
()
except
AttributeError
:
except
AttributeError
:
root
=
None
root
=
None
# Even if the context isn't a view (when would that be exaclty?),
# there shouldn't be any dange in applying a view, because it
# won't be used. However assuming that a lack of getPhysicalRoot
# implies a missing view causes problems.
view
=
self
.
_getContext
()
view
=
self
.
_getContext
()
here
=
aq_inner
(
self
.
context
)
here
=
aq_inner
(
self
.
context
)
try
:
request
=
aq_acquire
(
root
,
'REQUEST'
)
except
AttributeError
:
request
=
None
request
=
getattr
(
root
,
'REQUEST'
,
None
)
c
=
{
'template'
:
self
,
c
=
{
'template'
:
self
,
'here'
:
here
,
'here'
:
here
,
'context'
:
here
,
'context'
:
here
,
...
...
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