Commit e80fad7a authored by Evan Prodromou's avatar Evan Prodromou

handle Godaddy-style PATH_INFO which includes the script

parent aef434f9
...@@ -32,7 +32,13 @@ function getPath($req) ...@@ -32,7 +32,13 @@ function getPath($req)
&& array_key_exists('p', $req)) { && array_key_exists('p', $req)) {
return $req['p']; return $req['p'];
} else if (array_key_exists('PATH_INFO', $_SERVER)) { } else if (array_key_exists('PATH_INFO', $_SERVER)) {
return $_SERVER['PATH_INFO']; $path = $_SERVER['PATH_INFO'];
$script = $_SERVER['SCRIPT_NAME'];
if (substr($path, 0, mb_strlen($script)) == $script) {
return substr($path, mb_strlen($script));
} else {
return $path;
}
} else { } else {
return null; return null;
} }
......
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