Apply security hotfix 20160830 for redirects.
This commit is contained in:
@@ -105,7 +105,9 @@ class DeleteComment(BrowserView):
|
||||
type='info')
|
||||
came_from = self.context.REQUEST.HTTP_REFERER
|
||||
# if the referrer already has a came_from in it, don't redirect back
|
||||
if len(came_from) == 0 or 'came_from=' in came_from:
|
||||
if (len(came_from) == 0 or 'came_from=' in came_from or
|
||||
not getToolByName(
|
||||
content_object, 'portal_url').isURLInPortal(came_from)):
|
||||
came_from = content_object.absolute_url()
|
||||
return self.context.REQUEST.RESPONSE.redirect(came_from)
|
||||
|
||||
@@ -186,7 +188,9 @@ class PublishComment(BrowserView):
|
||||
type='info')
|
||||
came_from = self.context.REQUEST.HTTP_REFERER
|
||||
# if the referrer already has a came_from in it, don't redirect back
|
||||
if len(came_from) == 0 or 'came_from=' in came_from:
|
||||
if (len(came_from) == 0 or 'came_from=' in came_from or
|
||||
not getToolByName(
|
||||
content_object, 'portal_url').isURLInPortal(came_from)):
|
||||
came_from = content_object.absolute_url()
|
||||
return self.context.REQUEST.RESPONSE.redirect(came_from)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user