git.gnu.io has moved to IP address 209.51.188.249 -- please double check where you are logging in.

Commit c9d635b6 authored by Evan Prodromou's avatar Evan Prodromou

Fix hand-made trim in getPath() with ltrim (duh)

parent 6145df66
......@@ -59,7 +59,7 @@ function getPath($req)
$path = $_SERVER['PATH_INFO'];
$script = $_SERVER['SCRIPT_NAME'];
if (substr($path, 0, mb_strlen($script)) == $script) {
$p = substr($path, mb_strlen($script));
$p = substr($path, mb_strlen($script) + 1);
} else {
$p = $path;
}
......@@ -69,11 +69,7 @@ function getPath($req)
// Trim all initial '/'
if (!empty($p)) {
while ($p[0] == '/') {
$p = substr($p, 1);
}
}
$p = ltrim($p, '/');
return $p;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment