Made Special:Log tolerate literal, unescaped slashes in page names (hack of sorts, but still...)
authorDan
Wed, 15 Apr 2009 14:23:48 -0400
changeset 911 facff435cdaa
parent 910 e5de998b934b
child 912 95d0d8596c87
Made Special:Log tolerate literal, unescaped slashes in page names (hack of sorts, but still...)
plugins/SpecialLog.php
--- a/plugins/SpecialLog.php	Tue Apr 14 21:03:25 2009 -0400
+++ b/plugins/SpecialLog.php	Wed Apr 15 14:23:48 2009 -0400
@@ -82,10 +82,10 @@
       redirect($url, '', '', 0);
     }
     $params = explode('/', $params);
-    foreach ( $params as $param )
+    foreach ( $params as $i => $param )
     {
       $param = str_replace('.2f', '/', dirtify_page_id($param));
-      if ( preg_match('/^([a-z!]+)=(.+?)$/', $param, $match) )
+      if ( preg_match('/^([a-z]+)!?=(.+?)$/', $param, $match) )
       {
         $name =& $match[1];
         $value =& $match[2];
@@ -108,6 +108,22 @@
             }
             break;
           case 'page':
+            // tolerate slashes
+            $j = $i;
+            while ( true )
+            {
+              if ( isset($params[++$j]) )
+              {
+                if ( preg_match('/^([a-z]+)!?=(.+?)$/', $params[$j]) )
+                  break;
+                
+                $value .= '/' . $params[$j];
+              }
+              else
+              {
+                break;
+              }
+            }
             if ( get_class($perms) == 'sessionManager' )
             {
               unset($perms);