• Resolved MarkRH

    (@markrh)


    After my webhost upgraded to PHP 8.1.2 any posts using CodeColorer would barf at line 4698. Following what’s mentioned here: https://www.php.net/manual/en/function.create-function I corrected it by changing the following in /wp-content/plugins/codecolorer/geshi.php:

                if (!isset($callback_2)) {
                    //$callback_2 = create_function('$matches', 'return "[" . str_replace("|", "", $matches[1]) . "]";');
                    $callback_2 = function($matches) { return "[" . str_replace("|", "", $matches[1]) . "]"; };
                }

    Everything now works again and displays the syntax highlighting.

    Hope this helps.

    • This topic was modified 1 year, 12 months ago by MarkRH.
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘How to correct create_function() is deprecated error’ is closed to new replies.