aboutsummaryrefslogtreecommitdiffstats
path: root/index.php
diff options
context:
space:
mode:
Diffstat (limited to 'index.php')
-rw-r--r--index.php18
1 files changed, 17 insertions, 1 deletions
diff --git a/index.php b/index.php
index e10f5d0be..9293c754f 100644
--- a/index.php
+++ b/index.php
@@ -3,10 +3,26 @@
*/
require_once 'langs.inc.php';
+
+if (isset($_GET['flang']))
+{
+ $lang = array_key_exists($_GET['flang'], $langs) ? $_GET['flang'] : 'en';
+ if (isset($_GET['furl']))
+ {
+ $url = substr_replace($_GET['furl'], $lang, 1, 2);
+ }
+ else
+ $url = '/' . $lang . '/';
+
+ header(sprintf('Location: %s', $url));
+ die;
+}
+
require_once 'localeDetection.class.php';
$locale = new ChooseLocale(array_keys($langs));
$locale->setDefaultLocale('en');
-header(sprintf('Location: /%s/', $locale->getCompatibleLocale())); \ No newline at end of file
+header(sprintf('Location: /%s/', $locale->getCompatibleLocale()));
+die; \ No newline at end of file