aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--langs.php7
1 files changed, 4 insertions, 3 deletions
diff --git a/langs.php b/langs.php
index 5883af404..669956ec8 100644
--- a/langs.php
+++ b/langs.php
@@ -24,12 +24,13 @@ $langs = array(
$sru = trim($_SERVER['REQUEST_URI']);
$sel = explode('/', $sru);
-$locale = $sel[1];
-$page = isset($sel[2]) ? $sel[2] : null;
+array_shift($sel);
+$locale = array_shift($sel);
+$page = count($sel) > 0 ? implode('/', $sel) : null;
$list_langs = array();
foreach ($langs as $k => $v)
- $list_langs[] = sprintf('<a href="/%s/"%s>%s</a>',
+ $list_langs[] = sprintf('<a href="/%s"%s>%s</a>',
$page != null ? implode('/', array($k, $page)) : $k,
$k == $locale ? ' class="sel"' : '',
$v);