Fixed some bugs with $paths->getParam() and $paths->get_pageid_from_url() when slashes are in the namespace prefix. Result of testing on Windows Vista + Apache 2.2. Using TortoiseHG
authorDan
Tue, 26 Feb 2008 19:51:43 -0500
changeset 463 0857911fb7f1
parent 462 42a49ceb2373
child 464 8063eace5b67
Fixed some bugs with $paths->getParam() and $paths->get_pageid_from_url() when slashes are in the namespace prefix. Result of testing on Windows Vista + Apache 2.2. Using TortoiseHG
includes/paths.php
--- a/includes/paths.php	Sun Feb 24 19:55:22 2008 -0500
+++ b/includes/paths.php	Tue Feb 26 19:51:43 2008 -0500
@@ -442,7 +442,10 @@
     if ( substr($url, 0, strlen($this->nslist['Special'])) == $this->nslist['Special'] ||
          substr($url, 0, strlen($this->nslist['Admin']))   == $this->nslist['Admin'])
     {
-      list($url) = explode('/', $url);
+      list(, $ns) = RenderMan::strToPageID($url);
+      $upart = substr($url, strlen($this->nslist[$ns]));
+      list($upart) = explode('/', $upart);
+      $url = $this->nslist[$ns] . $upart;
     }
     return $url;
   }
@@ -492,6 +495,8 @@
   function getParam($id = 0)
   {
     $title = $this->parse_url(false);
+    list(, $ns) = RenderMan::strToPageID($title);
+    $title = substr($title, strlen($this->nslist[$ns]));
     $regex = '/^' . str_replace('/', '\\/', preg_quote($this->nslist[$this->namespace])) . '\\/?/';
     $title = preg_replace($regex, '', $title);
     $title = explode('/', $title);