← All changes
|
src/includes/externals/markdown/nc-markdown.inc.php
+6
-3
260805
→
260927
View file →
| @@ -1453,11 +1453,14 @@ | ||
| 1453 | 1453 | # function that will loosely count the number of UTF-8 characters with a |
| 1454 | 1454 | # regular expression. |
| 1455 | 1455 | # |
| 1456 | 1456 | if (function_exists($this->utf8_strlen)) return; |
| 1457 | - $this->utf8_strlen = create_function('$text', 'return preg_match_all( | |
| 1458 | - "/[\\\\x00-\\\\xBF]|[\\\\xC0-\\\\xFF][\\\\x80-\\\\xBF]*/", | |
| 1459 | - $text, $m);'); | |
| 1457 | + //260816 create_function() was removed in PHP 8; use a PHP 5.3+ closure for this fallback. | |
| 1458 | + $this->utf8_strlen = function($text) { | |
| 1459 | + return preg_match_all( | |
| 1460 | + "/[\\x00-\\xBF]|[\\xC0-\\xFF][\\x80-\\xBF]*/", | |
| 1461 | + $text, $m); | |
| 1462 | + }; | |
| 1460 | 1463 | } |
| 1461 | 1464 | |
| 1462 | 1465 | |
| 1463 | 1466 | function unhash($text) { |