publisher: reset substitution sources early on (#6833)

In case of access to an unknown host try_publish() would bail out early with a
TraversalError() (404), which would access the publisher known substitution
variables to render the error page.  That list was not reset yet from the
previous call and could thus result in inappropriate variables being created.
This commit is contained in:
Frédéric Péters 2015-03-26 12:02:44 +01:00
parent 96aa0d897c
commit 0096bd61c6
1 changed files with 2 additions and 1 deletions

View File

@ -511,6 +511,8 @@ class QommonPublisher(Publisher):
return False
def try_publish(self, request):
self.substitutions.reset()
try:
self.set_app_dir(request)
except ImmediateRedirectException, e:
@ -577,7 +579,6 @@ class QommonPublisher(Publisher):
request.language = self.get_site_language()
self.install_lang(request.language)
self.substitutions.reset()
self.substitutions.feed(self)
self.substitutions.feed(request)
for extra_source in self.extra_sources: