Fixed special pages being returned with subpage information inappropriately from $paths->get_pageid_from_url()
authorDan
Thu, 31 Jan 2008 21:52:39 -0500
changeset 280 7b984f924dcd
parent 279 b6faa6d6ade2
child 282 43b908c9b2e2
Fixed special pages being returned with subpage information inappropriately from $paths->get_pageid_from_url()
includes/paths.php
--- a/includes/paths.php	Mon Jan 28 23:07:32 2008 -0500
+++ b/includes/paths.php	Thu Jan 31 21:52:39 2008 -0500
@@ -495,11 +495,8 @@
         header('Location: '.$loc);
         exit;
       }
-      if( !( substr($pi[1], 0, strlen($this->nslist['Special'])) == $this->nslist['Special'] ) )
-      {
-        unset($pi[0]);
-        $pi[1] = implode('/', $pi);
-      }
+      unset($pi[0]);
+      $pi[1] = implode('/', $pi);
       $ret = $pi[1];
     }
     else
@@ -521,6 +518,14 @@
       }
     }
     
+    if ( isset($ret) )
+    {
+      if ( substr($ret, 0, ( strlen($this->nslist['Special']) )) == $this->nslist['Special'] && strstr($ret, '/') )
+      {
+        list ( $ret ) = explode('/', $ret);
+      }
+    }
+    
     return ( isset($ret) ) ? $ret : false;
   }
   // Parses a (very carefully formed) array into Javascript code compatible with the Tigra Tree Menu used in the admin menu