[pmwiki-users] Problems updating to latest PmWiki version (2.2.61)

Hans B design at softflow.co.uk
Thu Feb 20 07:08:32 CST 2014


I am trying to update from an older version (2.2.35).
I get multiple warning errors like this:

Warning: _() expects parameter 1 to be string, array given in ......./pmwiki.php on line 467

I see the error occurs in calls to function PPRA.

I narrowed down what causes the warnings.
It appears it stems from defining  $MakePageNamePatterns in config.php.

I have been using this successfully:

$MakePageNamePatterns = array(
    "/'/" => '',                           # strip single-quotes
    "/[^$PageNameChars]+/" => ' ',         # convert everything else to space
    '/((^|[^-\\w])\\w)/e' => "strtoupper('$1')", # make first letters upper case
    '/ /' => '_'
);  # convert spaces to underscores

I changed it to this, to get rid of the /e modifier in the third item, as required for
PHP 5.5 compliance:

$MakePageNamePatterns = array(
    "/'/" => '',                           # strip single-quotes
    "/[^$PageNameChars]+/" => ' ',         # convert everything else to space 
    '/((^|[^-\\w])\\w)/' => PCCF("return strtoupper(\$m[1]);"), # make first letters upper case    
    '/ /' => '_',  # convert spaces to underscores       
);

but it appears that the last array entry, which should convert spaces
to underscores, is bringing up the warnings.
How can this be solved? I have no idea what is going on there.

Note: I use some wikis where page names have underscores separating the
words, so not just standard CamelCase page names, but names like
Home_Page in the URL.

Thanks for any help!

PS: I am in the process   upgrading a number of recipes to be  PHP
5.5 compliant, and run into this upgrade problem working on it.


Best,
 HansB (on pmwiki.org)





More information about the pmwiki-users mailing list