]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - index.php
Merge branch '0.9.x' of git@gitorious.org:statusnet/mainline into 0.9.x
[quix0rs-gnu-social.git] / index.php
index 8ff67d19d9165def2675d5c6955b435f8b884d8d..3acdba3754a7c095618efe6eacbc96dffd98e9c4 100644 (file)
--- a/index.php
+++ b/index.php
@@ -49,12 +49,23 @@ function getPath($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;
     }
 }
 
+/**
+ * logs and then displays error messages
+ *
+ * @return void
+ */
 function handleError($error)
 {
     if ($error->getCode() == DB_DATAOBJECT_ERROR_NODATA) {
@@ -132,7 +143,7 @@ function checkMirror($action_obj, $args)
 
 function isLoginAction($action)
 {
-    static $loginActions =  array('login', 'recoverpassword', 'api', 'doc', 'register');
+    static $loginActions =  array('login', 'recoverpassword', 'api', 'doc', 'register', 'publicxrds');
 
     $login = null;