includes/paths.php
changeset 515 be77f34d03af
parent 510 290fa071842a
child 536 218a627eb53e
--- a/includes/paths.php	Sun Mar 30 07:24:48 2008 -0700
+++ b/includes/paths.php	Tue Apr 01 01:24:10 2008 -0400
@@ -107,13 +107,21 @@
   function parse_url($sanitize = true)
   {
     $title = '';
-    if( isset($_GET['title']) )
+    if ( isset($_GET['title']) )
     {
       $title = $_GET['title'];
     }
-    elseif( isset($_SERVER['PATH_INFO']) )
+    else if ( isset($_SERVER['PATH_INFO']) )
     {
-      $title = substr($_SERVER['PATH_INFO'], ( strpos($_SERVER['PATH_INFO'], '/') ) + 1 );
+      // fix for apache + CGI (occurred on a GoDaddy server, thanks mm3)
+      if ( @substr(@$_SERVER['GATEWAY_INTERFACE'], 0, 3) === 'CGI' && $_SERVER['PATH_INFO'] == scriptPath . '/index.php' )
+      {
+        // do nothing; ignore PATH_INFO
+      }
+      else
+      {
+        $title = substr($_SERVER['PATH_INFO'], ( strpos($_SERVER['PATH_INFO'], '/') ) + 1 );
+      }
     }
     else
     {