[pmwiki-users] Alternate Naming Scheme: problem in setting

Patrick R. Michaud pmichaud at pobox.com
Sat Oct 15 18:26:51 CDT 2005


On Thu, Oct 13, 2005 at 05:57:29PM +0200, Xax wrote:
>    If I insert the following in my config.php
> 
>          $MakePageNamePatterns = array(
>      "/'/" => '',                        # strip single-quotes
>      "/[^$PageNameChars]+/" => ' ',         # convert everything else to space
>      "/((^|[^-\\w])\\w)/e" => "strtoupper('$1')",
>      "/ /" => '_');
> 
>    I get this error:
> 
>    Warning: Compilation failed: missing terminating ] for character class at
>    offset 4 in /usr/www/users/maxlumen/cgitalia.it/guida/pmwiki.php on line
>    419

The problem is that at the point where this is executed, $PageNameChars
doesn't yet have a value and so the second rule (convert everything
else to space) ends up being an invalid rule.

So, somehow we need to get $PageNameChars set to the correct value
before executing this markup... easiest might be to just set it
directly:

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

Pm





More information about the pmwiki-users mailing list