From: George Peter Banyard Date: Fri, 3 Apr 2020 19:16:04 +0000 (+0200) Subject: Fix Bug #79448 0 is a valid Unicode codepoint, but mb_substitute_character(0) fails X-Git-Tag: php-7.3.18RC1~24 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1333b46d6dc0c293c1fd626803f91bc69743eb79;p=php Fix Bug #79448 0 is a valid Unicode codepoint, but mb_substitute_character(0) fails --- diff --git a/ext/mbstring/mbstring.c b/ext/mbstring/mbstring.c index 0f466a02ee..ba30e05c27 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 new file mode 100644 index 0000000000..09052943cc --- /dev/null +++ b/ext/mbstring/tests/bug79448.phpt @@ -0,0 +1,11 @@ +--TEST-- +Bug #79448 0 is a valid Unicode codepoint, but mb_substitute_character(0) fails +--SKIPIF-- + +--FILE-- + +--EXPECT-- +bool(true)