update for PHP 7.2 compatibility

This commit is contained in:
Max Kostikov 2017-12-06 19:49:53 +02:00 committed by GitHub
parent 4500fe78e1
commit c156c77002
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 2 deletions

View File

@ -234,7 +234,9 @@ class Text {
public static function pre2htmlentities($string) public static function pre2htmlentities($string)
{ {
return preg_replace_callback('/<pre.*?><code(.*?)>(.*?)<\/code><\/pre>/imsu', return preg_replace_callback('/<pre.*?><code(.*?)>(.*?)<\/code><\/pre>/imsu',
create_function('$input', 'return "<pre><code $input[1]>".htmlentities($input[2])."</code></pre>";'), function ($input) {
return "<pre><code $input[1]>".htmlentities($input[2])."</code></pre>";
},
$string); $string);
} }
@ -263,4 +265,4 @@ class Text {
return $truncate; return $truncate;
} }
} }