[pmwiki-users] PmWiki 2.2.107 released

Paul Wiegmans p.wiegmans at inter.nl.net
Tue Feb 6 09:16:44 CST 2018


Hi Moni!
Op 5-2-2018 om 11:36 schreef Moni Kellermann:
> Am 02.02.2018 um 18:51 schrieb Petko Yotov:
>> Hello. PmWiki version 2.2.107 was published today
>
> Thank you, Petko! :))
>
> I am trying out this skin:
> http://www.pmwiki.org/wiki/Skins/Vanilla5
>
> With PmWiki 2.2.107 running on XAMPP/PHP 7.21, I now get the error
>
> Deprecated: Function create_function() is deprecated in 
> C:\xampp\htdocs\pmwiki-2.2.107\pmwiki.php on line 481
>
> which refers to the section
>
> function PCCF($code, $template = 'default', $args = '$m') {
>   global $CallbackFnTemplates, $CallbackFunctions;
>   if (!isset($CallbackFnTemplates[$template]))
>     Abort("No \$CallbackFnTemplates[$template]).");
>   $code = sprintf($CallbackFnTemplates[$template], $code);
>   if (!isset($CallbackFunctions[$code])) {
>   $fn = create_function($args, $code);
>     if ($fn) $CallbackFunctions[$code] = $fn;
>     else StopWatch("Failed to create callback function: ".PHSC($code));
>   }
>   return $CallbackFunctions[$code];
> }
>
> and specifically the line
>
>   $fn = create_function($args, $code);
>
> I understand that create_function is deprecated in PHP 7.21, and that 
> the fault is with the skin, not with PmWiki, as the standard skins do 
> not trigger this.
>
> Which means that a) we need to fix both pmwiki.php as well as the skin.
> I get the same error with the Twitter Bootstrap skin.
>
> Both those skins work with 2.2.107 when running XAMPP/PHP 5.6.33.
>
>
> moni k.
>
>
As author of the skin Vanilla5, I am feeling obliged to respond here. My 
webserver does not use PHP7.2 yet, so I did not encounter any problems 
YET.  I don't feel confident enough programming in PHP to offer you a 
real fix.

In the mean time, you can get it working by commenting out the 2 lines 
in the bottom section of "skin.php" which call the Markup_e() function. 
It should look like this:

$FmtPV['$SearchBar'] = "\$GLOBALS['TmplDisplay']['PageSearchFmt']";
#Markup_e('nosearch', 'directives', '/\\(:nosearch:\\)/i', 
"SetTmplDisplay('PageSearchFmt',0)");
$FmtPV['$TabsBar'] = "\$GLOBALS['TmplDisplay']['PageTabsFmt']";
#Markup_e('notabs', 'directives', '/\\(:notabs:\\)/i', 
"SetTmplDisplay('PageTabsFmt',0)");

You loose the functionality of disabling and enabling the (:nosearch:) 
and (:notabs:) directives. It should now be working.


with regards,

Paul Wiegmans



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.pmichaud.com/pipermail/pmwiki-users/attachments/20180206/c02a93a8/attachment.html>


More information about the pmwiki-users mailing list