]> 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 208259eb6ab95c26253e28a419f716a989afbba5..644812bd55ac1c8b1549fd4446189266f3c121af 100644 (file)
--- a/index.php
+++ b/index.php
  *
  * @category StatusNet
  * @package  StatusNet
- * @license  GNU Affero General Public License http://www.gnu.org/licenses/
- * @author   Brenda Wallace <shiny@cpan.org> 
- * @author   Christopher Vollick <psycotica0@gmail.com> 
+ * @author   Brenda Wallace <shiny@cpan.org>
+ * @author   Christopher Vollick <psycotica0@gmail.com>
  * @author   CiaranG <ciaran@ciarang.com>
- * @author   Craig Andrews <candrews@integralblue.com> 
+ * @author   Craig Andrews <candrews@integralblue.com>
  * @author   Evan Prodromou <evan@controlezvous.ca>
- * @author   Evan Prodromou <evan@controlyourself.ca> 
- * @author   Evan Prodromou <evan@prodromou.name>
- * @author   Evan Prodromou <evan@status.net>
- * @author   Gina Haeussge <osd@foosel.net> 
+ * @author   Gina Haeussge <osd@foosel.net>
  * @author   Jeffery To <jeffery.to@gmail.com>
  * @author   Mike Cochrane <mikec@mikenz.geek.nz>
  * @author   Robin Millette <millette@controlyourself.ca>
- * @author   Sarven Capadisli <csarven@controlyourself.ca> 
+ * @author   Sarven Capadisli <csarven@controlyourself.ca>
  * @author   Tom Adams <tom@holizz.com>
+ * 
+ * @license  GNU Affero General Public License http://www.gnu.org/licenses/
  */
 
 define('INSTALLDIR', dirname(__FILE__));
@@ -51,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) {