Support » Plugin: Rizzi Guestbook » Warning: preg_replace()

  • Hi
    I receive this error on all pages the have a guestbook and comments attached.

    Warning: preg_replace() [function.preg-replace]: The /e modifier is no longer supported, use preg_replace_callback instead in /var/www/myWebsite/public_html/wp-content/plugins/rizzi-guestbook/Rizzi-Guestbook.php on line 123

    Can you please help resolving this. It came after upgrading WP to 4.5.3

    https://wordpress.org/plugins/rizzi-guestbook/

Viewing 1 replies (of 1 total)
  • Thread Starter stuf99

    (@stuf99)

    I did as suggested and implemented the preg_replace_callback.

    Old code
    return preg_replace(‘/\[img=?\]*(.*?)(\[\/img)?\]/e’, ‘”<img src=\”$1\” class=\”ecu_images\” alt=\”” . basename(“$1”) . “\” />”‘, $content);

    New code
    return preg_replace_callback(‘/\[img=?\]*(.*?)(\[\/img)?\]/e’,function($m) { return ‘”<img src=\”$1\” class=\”ecu_images\” alt=\”” . basename(“$1”) . “\” />”‘}, $content);

Viewing 1 replies (of 1 total)
  • The topic ‘Warning: preg_replace()’ is closed to new replies.