Tweaked URL sanitizing a bit to make Enanium work better.
authorDan
Wed, 29 Jul 2009 11:48:54 -0400
changeset 1061 4ef865b5f497
parent 1060 d3e12f1f9f29
child 1062 3780b5464778
Tweaked URL sanitizing a bit to make Enanium work better.
includes/functions.php
includes/template.php
--- a/includes/functions.php	Wed Jul 29 10:48:43 2009 -0400
+++ b/includes/functions.php	Wed Jul 29 11:48:54 2009 -0400
@@ -2512,7 +2512,7 @@
   // Remove character escapes
   $page_id = dirtify_page_id($page_id);
 
-  $pid_clean = preg_replace('/[\w\.\/:;\(\)@\[\]_-]/', 'X', $page_id);
+  $pid_clean = preg_replace('/[\w\.\/:;\(\)@\[\]=_-]/', 'X', $page_id);
   $pid_dirty = enano_str_split($pid_clean, 1);
   
   foreach ( $pid_dirty as $id => $char )
@@ -2577,7 +2577,7 @@
     $char = strtolower($char);
     $char = intval(hexdec($char));
     $char = chr($char);
-    if ( preg_match('/^[\w\.\/:;\(\)@\[\]_-]$/', $char) )
+    if ( preg_match('/^[\w\.\/:;\(\)@\[\]=_-]$/', $char) )
       continue;
     $page_id = str_replace($matches[0][$id], $char, $page_id);
   }
--- a/includes/template.php	Wed Jul 29 10:48:43 2009 -0400
+++ b/includes/template.php	Wed Jul 29 11:48:54 2009 -0400
@@ -1771,7 +1771,7 @@
         $params = false;
       $escape = !empty($escape);
       
-      $result = makeUrlNS($namespace, $page_id, $params, $escape);
+      $result = makeUrlNS($namespace, sanitize_page_id($page_id), $params, $escape);
       
       if ( !$post_eval )
       {