aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRomain d'Alverny <rda@mageia.org>2011-11-25 13:15:52 +0000
committerRomain d'Alverny <rda@mageia.org>2011-11-25 13:15:52 +0000
commitcc6a7e3e861955ac85da0bb3050bba67d3ae7c3b (patch)
treefa2ba5cf38529e1de4ae7dd7b80fb3ded8ff25b5
parent68a980b03bec70cf116c4962d62a32fc1e35577b (diff)
downloadwww-cc6a7e3e861955ac85da0bb3050bba67d3ae7c3b.tar
www-cc6a7e3e861955ac85da0bb3050bba67d3ae7c3b.tar.gz
www-cc6a7e3e861955ac85da0bb3050bba67d3ae7c3b.tar.bz2
www-cc6a7e3e861955ac85da0bb3050bba67d3ae7c3b.tar.xz
www-cc6a7e3e861955ac85da0bb3050bba67d3ae7c3b.zip
fix redirection
-rw-r--r--downloads/get/index.php4
-rw-r--r--langs.inc.php4
2 files changed, 6 insertions, 2 deletions
diff --git a/downloads/get/index.php b/downloads/get/index.php
new file mode 100644
index 000000000..b48e56cc0
--- /dev/null
+++ b/downloads/get/index.php
@@ -0,0 +1,4 @@
+<?php
+
+require_once '../langs.inc.php';
+relocate($langs, $_SERVER['REQUEST_URI']); \ No newline at end of file
diff --git a/langs.inc.php b/langs.inc.php
index cb0704cb3..49f326f9d 100644
--- a/langs.inc.php
+++ b/langs.inc.php
@@ -101,10 +101,10 @@ function relocate($langs, $page = '', $default_locale = 'en')
$locale->setDefaultLocale($default_locale);
- header(sprintf('Location: /%s/%s',
+ header(str_replace('//', '/', sprintf('Location: /%s/%s',
$locale->getCompatibleLocale(),
$page
- ));
+ )));
die;
}