Merge pull request #571 from xm74/patch-1

text.class.php update for PHP 7.2 compatibility
This commit is contained in:
Diego Najar 2017-12-09 20:32:22 +01:00 committed by GitHub
commit 078fdb344c
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;
} }
} }