From: George Peter Banyard Date: Tue, 7 Apr 2020 20:23:24 +0000 (+0200) Subject: Revert "Fix Bug #79448 0 is a valid Unicode codepoint, but mb_substitute_character... X-Git-Tag: php-7.3.18RC1~21 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6031b0824012065b679ed193b6e11b324a5cc92e;p=php Revert "Fix Bug #79448 0 is a valid Unicode codepoint, but mb_substitute_character(0) fails" This commit brings some substantial changes in behaviour due to the weird implementation. This will be fixed in master due to BC concerns. This reverts commit 1333b46d6dc0c293c1fd626803f91bc69743eb79. --- diff --git a/ext/mbstring/mbstring.c b/ext/mbstring/mbstring.c index ba30e05c27..0f466a02ee 100644 --- a/ext/mbstring/mbstring.c +++ b/ext/mbstring/mbstring.c @@ -2038,7 +2038,7 @@ PHP_FUNCTION(mb_detect_order) static inline int php_mb_check_code_point(zend_long cp) { - if (cp < 0 || cp >= 0x110000) { + if (cp <= 0 || cp >= 0x110000) { /* Out of Unicode range */ return 0; } diff --git a/ext/mbstring/tests/bug79448.phpt b/ext/mbstring/tests/bug79448.phpt deleted file mode 100644 index 09052943cc..0000000000 --- a/ext/mbstring/tests/bug79448.phpt +++ /dev/null @@ -1,11 +0,0 @@ ---TEST-- -Bug #79448 0 is a valid Unicode codepoint, but mb_substitute_character(0) fails ---SKIPIF-- - ---FILE-- - ---EXPECT-- -bool(true)