includes/functions.php
changeset 1061 4ef865b5f497
parent 1035 d0d617124b29
child 1081 745200a9cc2a
equal deleted inserted replaced
1060:d3e12f1f9f29 1061:4ef865b5f497
  2510     return '';
  2510     return '';
  2511   
  2511   
  2512   // Remove character escapes
  2512   // Remove character escapes
  2513   $page_id = dirtify_page_id($page_id);
  2513   $page_id = dirtify_page_id($page_id);
  2514 
  2514 
  2515   $pid_clean = preg_replace('/[\w\.\/:;\(\)@\[\]_-]/', 'X', $page_id);
  2515   $pid_clean = preg_replace('/[\w\.\/:;\(\)@\[\]=_-]/', 'X', $page_id);
  2516   $pid_dirty = enano_str_split($pid_clean, 1);
  2516   $pid_dirty = enano_str_split($pid_clean, 1);
  2517   
  2517   
  2518   foreach ( $pid_dirty as $id => $char )
  2518   foreach ( $pid_dirty as $id => $char )
  2519   {
  2519   {
  2520     if ( $char == 'X' )
  2520     if ( $char == 'X' )
  2575   {
  2575   {
  2576     $char = substr($char, 1);
  2576     $char = substr($char, 1);
  2577     $char = strtolower($char);
  2577     $char = strtolower($char);
  2578     $char = intval(hexdec($char));
  2578     $char = intval(hexdec($char));
  2579     $char = chr($char);
  2579     $char = chr($char);
  2580     if ( preg_match('/^[\w\.\/:;\(\)@\[\]_-]$/', $char) )
  2580     if ( preg_match('/^[\w\.\/:;\(\)@\[\]=_-]$/', $char) )
  2581       continue;
  2581       continue;
  2582     $page_id = str_replace($matches[0][$id], $char, $page_id);
  2582     $page_id = str_replace($matches[0][$id], $char, $page_id);
  2583   }
  2583   }
  2584   
  2584   
  2585   return $page_id;
  2585   return $page_id;