summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvan Prodromou <evan@status.net>2009-09-19 15:06:16 -0400
committerEvan Prodromou <evan@status.net>2009-09-19 15:07:47 -0400
commitfd86c6eb1997ae3c9cd4b143ee253784d7603a6b (patch)
treea1174e8f57a3acc6d43f2f28823543e7f349ad97
parentf2ecfd237007b8ffafd8c74a290549f5966c107e (diff)
handle Godaddy-style PATH_INFO which includes the script
-rw-r--r--index.php8
1 files changed, 7 insertions, 1 deletions
diff --git a/index.php b/index.php
index 7669778f6..362ab3cd3 100644
--- a/index.php
+++ b/index.php
@@ -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;
}