summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier Dony <odo@openerp.com>2016-07-25 11:38:52 +0200
committerOlivier Dony <odo@openerp.com>2016-07-25 13:05:01 +0200
commit01acb8a497317162770df1a29e0236ae7d8f58bc (patch)
tree3019626ef636f5b9f482a52a201c6d80bb3c6041
parent3ff242ec0c48125c958d5c512e942cce73effe76 (diff)
[FIX] base: fix broken URLs when redirecting
Similarly to werkzeug.urls.url_fix(), attempt to correct some leftover special characters that should have been URL-encoded. We cannot actually use `werkzeug.urls.url_fix` or `werkzeug.urls.url_quote`, as they expect more/most characters to be un-encoded. We have many existing cases where the redirect URL is already fully encoded or mostly encoded, and those functions would cause double-encoding, breaking the final URL.
-rw-r--r--openerp/http.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/openerp/http.py b/openerp/http.py
index 73fd66fc087..5d85de44460 100644
--- a/openerp/http.py
+++ b/openerp/http.py
@@ -159,6 +159,7 @@ def redirect_with_hash(url, code=303):
# See extensive test page at http://greenbytes.de/tech/tc/httpredirects/
if request.httprequest.user_agent.browser in ('firefox',):
return werkzeug.utils.redirect(url, code)
+ url = url.replace("'", "%27").replace("<", "%3C")
return "<html><head><script>window.location = '%s' + location.hash;</script></head></html>" % url
class WebRequest(object):