Commit 07315f18 authored by Hanno Schlichting's avatar Hanno Schlichting

Avoid infinite recursion for messed up aq_chains.

parent 78a1ca3e
...@@ -17,6 +17,7 @@ $Id$ ...@@ -17,6 +17,7 @@ $Id$
""" """
import zope.app.pagetemplate import zope.app.pagetemplate
from Acquisition import aq_base
from Acquisition import aq_parent from Acquisition import aq_parent
from AccessControl import getSecurityManager from AccessControl import getSecurityManager
from Products.PageTemplates.Expressions import SecureModuleImporter from Products.PageTemplates.Expressions import SecureModuleImporter
...@@ -38,7 +39,7 @@ class ViewPageTemplateFile(zope.app.pagetemplate.ViewPageTemplateFile): ...@@ -38,7 +39,7 @@ class ViewPageTemplateFile(zope.app.pagetemplate.ViewPageTemplateFile):
# get the root # get the root
obj = context['context'] obj = context['context']
root = None root = None
while (getattr(obj, 'getPhysicalRoot', None) is None while (getattr(aq_base(obj), 'getPhysicalRoot', None) is None
and aq_parent(obj) is not None): and aq_parent(obj) is not None):
obj = aq_parent(obj) obj = aq_parent(obj)
if getattr(obj, 'getPhysicalRoot', None) is not None: if getattr(obj, 'getPhysicalRoot', None) is not None:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment