Leandro Fanzone writes:
$NamePattern = '[[:upper:]\\d][\\w]*(?:-\\w+)*';

And I changed it to:

$NamePattern = '[\\w\\x80-\\xfe]+(?:-[[\\w\\x80-\\xfe]+)*';

I suggest you to NOT modify pmwiki.php and other core files, any such variable can be simply defined in config.php, so just write that line on config.php.

This will make future upgrades much easier - you will not have to re-edit pmwiki.php.

So the Latin1 characters could be included. Likewise, in MakePageName(), I changed

SDV($PageNameChars,'-[:alnum:]');
SDV($MakePageNamePatterns, array(
    "/'/" => '',               # strip single-quotes
    "/[^$PageNameChars]+/" => ' ',         # convert everything else to space
    '/((^|[^-\\w])\\w)/e' => "strtoupper('$1')",
    '/ /' => ''));

to:

SDV($PageNameChars,'-[:alnum:]\\x80-\\xfe');
SDV($MakePageNamePatterns, array(
    "/'/" => '',                           # strip single-quotes
    "/[^$PageNameChars]+/" => ' ',         # convert everything else to space
    "/(?<=^| )([a-z])/e" => "strtoupper('$1')",
    "/ /" => ''));

Again, just define these variables in config.php instead of modifying pmwiki.php:

 $PageNameChars = '-[:alnum:]\\x80-\\xfe';
 $MakePageNamePatterns = array(
   "/'/" => '',                           # strip single-quotes
   "/[^$PageNameChars]+/" => ' ',         # convert everything else to space
   "/(?<=^| )([a-z])/e" => "strtoupper('$1')",
   "/ /" => '');

The SDV() and SDVA() functions only set values of the variables or arrays if the variables are not defined, for example in config.php.

Petko


_______________________________________________
pmwiki-users mailing list
[email protected]
http://www.pmichaud.com/mailman/listinfo/pmwiki-users

Reply via email to