Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Htmlawed causing a fatal error on PHP 5.5.3 - preg_replace(): The /e modifier is deprecated


I'm having troubles with Vanilla Forums 2.1b2. For some reason, when I view a discussion on the forum as a guest (not as a logged in user), it gives me a "Something has gone wrong" error, and when enabling debug in the config, it gives me this screen about a fatal error:

I have tried to fix it by replacing line 382 with

$t = str_replace( // PHP 5.5 preg_replace_callback style
  array("\t", "\r", "\n", ' '), 
    function($m) {
      return substr(str_replace(array(";", "|", "~", " ", ",", "/", "(", ")", '`"'), 
        array("\x01", "\x02", "\x03", "\x04", "\x05", "\x06", "\x07", "\x08", "\""),
        $m[0]), 1, -1);

but then it prints out another error:

Now I'm completely confused about how to fix this. Is there a way to fix it, or am I doing_it_wrong()?

Best Answers


  • Options
    vrijvlindervrijvlinder Papillon-Sauvage MVP

    Can you please try this using php version 5.4 ?

Sign In or Register to comment.