Commit 85256813 authored by Georgios Dagkakis's avatar Georgios Dagkakis

WebSite.py: fix getExtensibleContent to correctly apply trailing slash

in case we publish with different languages
parent 04054d11
......@@ -177,11 +177,14 @@ class WebSite(WebSection):
request['AcceptLanguage'].set(name, 100)
request.set(WEBSITE_LANGUAGE_KEY, name)
if self.isTempObject() or name == default_language:
redirect_path_list = [self.getOriginalDocument().absolute_url()]
original_url = self.getOriginalDocument().absolute_url()
if original_url.endswith('/'):
original_url = original_url[:-1]
redirect_path_list = [original_url]
if name != default_language:
redirect_path_list.append(name)
redirect_path_list.extend(reversed(request['TraversalRequestNameStack']))
request['minimum_language_redirect_url'] = '/'.join(redirect_path_list)
request['minimum_language_redirect_url'] = '/'.join(redirect_path_list) + '/'
query_string = request.get('QUERY_STRING')
if query_string:
request['minimum_language_redirect_url'] += '?' + query_string
......
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