diff options
author | Evan Prodromou <evan@status.net> | 2009-09-19 15:06:16 -0400 |
---|---|---|
committer | Evan Prodromou <evan@status.net> | 2009-09-19 15:06:16 -0400 |
commit | e80fad7ad9bd0bee6a9cf4cfd1615a9b07277364 (patch) | |
tree | 28dc8119b50fc42f55c300b487dd3a0108b14adf /index.php | |
parent | aef434f9b2a8865facc34270cc0f19e8b7967f79 (diff) |
handle Godaddy-style PATH_INFO which includes the script
Diffstat (limited to 'index.php')
-rw-r--r-- | index.php | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -32,7 +32,13 @@ function getPath($req) && array_key_exists('p', $req)) { return $req['p']; } 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 { return null; } |