summaryrefslogtreecommitdiff
path: root/data
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2015-07-19 01:32:21 +0200
committerYorhel <git@yorhel.nl>2015-07-19 01:32:21 +0200
commitd8c2d33dc57e1d26d6fe5d63fd08872effe0c0fa (patch)
tree78433f867f72a6b5d165be8e33826dc7e6251d2b /data
parent9c7776828a722edcd7bb5eb0ebf61e4a08d7ecd2 (diff)
Remove reliance on Referer header for language switching
First step in removing the use of the Referer header for redirects. The Referer header is ugly and not always reliable, it's better to encode the required information in the URL.
Diffstat (limited to 'data')
-rw-r--r--data/script.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/data/script.js b/data/script.js
index 396d8ded..7e04c1e0 100644
--- a/data/script.js
+++ b/data/script.js
@@ -3314,7 +3314,7 @@ if(byId('lang_select')) {
var icon = tag('acronym', {'class':'icons lang '+ln[0]}, ' ');
lst.appendChild(tag('li', {'class':'lang_selector'}, curlang == ln[0]
? tag('i', icon, mt('_lang_'+ln[0]))
- : tag('a', {href:'/setlang?lang='+ln[0]}, icon, ln[1])
+ : tag('a', {href:'/setlang?lang='+ln[0]+';ref='+encodeURIComponent(location.pathname+location.search)}, icon, ln[1])
));
}
return lst;