]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
handle Godaddy-style PATH_INFO which includes the script
authorEvan Prodromou <evan@status.net>
Sat, 19 Sep 2009 19:06:16 +0000 (15:06 -0400)
committerEvan Prodromou <evan@status.net>
Sat, 19 Sep 2009 19:07:47 +0000 (15:07 -0400)
index.php

index 7669778f64e68a60081da00feb564494e4f78117..362ab3cd37e1bef5cd189703f949063c99c6309c 100644 (file)
--- 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;
     }