[pmwiki-users] Deprecated error after upgrade to version 2.3.11

Hans-Jürgen Godau juergen at godau-witten.de
Thu Sep 15 08:25:27 PDT 2022


After upgrqading pmwiki to vs. 2.3.11 i got the error

*Deprecated*: preg_replace(): Passing null to parameter #3 ($subject) of
type array|string is deprecated in
*/home2/godau/public_html/valentin/wiki/pmwiki.php* on line *75*

My installed php Version is 8.2*. *I changed line 75 from

 $ChangeSummary = substr(preg_replace('/[\\x00-\\x1f]|=\\]/', '',
        stripmagic(@$_REQUEST['csum'])), 0, 100);

to

$ChangeSummary = stripmagic(@$_REQUEST['csum']);
if (!is_null($ChangeSummary) && strlen($ChangeSummary) > 0) {
  $ChangeSummary = substr(preg_replace('/[\\x00-\\x1f]|=\\]/', '',
$ChangeSummary), 0, 100);
}

and pmwiki ran without the deprecated warning.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.pmichaud.com/pipermail/pmwiki-users/attachments/20220915/0a91ab57/attachment.html>


More information about the pmwiki-users mailing list