aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRomain d'Alverny <rda@mageia.org>2010-10-11 19:12:46 +0000
committerRomain d'Alverny <rda@mageia.org>2010-10-11 19:12:46 +0000
commit5682e3de7041b833087c6b4269f278f4b6fd877e (patch)
tree887c2bab2d3803ca97ed839ffb93990efe0fccfa
parent57992b2f7f179d28b07d72d548303d3b21d1a606 (diff)
downloadwww-5682e3de7041b833087c6b4269f278f4b6fd877e.tar
www-5682e3de7041b833087c6b4269f278f4b6fd877e.tar.gz
www-5682e3de7041b833087c6b4269f278f4b6fd877e.tar.bz2
www-5682e3de7041b833087c6b4269f278f4b6fd877e.tar.xz
www-5682e3de7041b833087c6b4269f278f4b6fd877e.zip
fixes incorrect locale alternative links in menu
-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);