Fix Geshi for PHP7.2+

This will fix "Function create_function() is deprecated".
This commit is contained in:
Razvan Rosca 2018-07-24 21:15:35 +03:00 committed by GitHub
parent 20077ab2a0
commit 2537c599d3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4695,7 +4695,7 @@ class GeSHi {
// TODO: a|bb|c => [ac]|bb
static $callback_2;
if (!isset($callback_2)) {
$callback_2 = create_function('$matches', 'return "[" . str_replace("|", "", $matches[1]) . "]";');
$callback_2 = function($matches) { return "[" . str_replace("|", "", $matches[1]) . "]"; };
}
$list = preg_replace_callback('#\(\?\:((?:.\|)+.)\)#', $callback_2, $list);
}