diff options
author | George Peter Banyard <girgias@php.net> | 2020-04-03 21:30:35 +0200 |
---|---|---|
committer | George Peter Banyard <girgias@php.net> | 2020-04-03 21:30:35 +0200 |
commit | 9cb9c53f1ff390370a8b6f691c1ec8bb2df8f2f2 (patch) | |
tree | ea39fcf030e81b4c9e281baf73f94f61661eec39 /ext | |
parent | 02a685ead327ce72e6e1cca76072e6ec5983c5bb (diff) | |
parent | 7a4261187091f5376107561577c0d444b2788b9c (diff) | |
download | php-git-9cb9c53f1ff390370a8b6f691c1ec8bb2df8f2f2.tar.gz |
Merge branch 'PHP-7.4'
Diffstat (limited to 'ext')
-rw-r--r-- | ext/mbstring/mbstring.c | 2 | ||||
-rw-r--r-- | ext/mbstring/tests/bug79448.phpt | 11 |
2 files changed, 12 insertions, 1 deletions
diff --git a/ext/mbstring/mbstring.c b/ext/mbstring/mbstring.c index 74a815c036..a327d63104 100644 --- a/ext/mbstring/mbstring.c +++ b/ext/mbstring/mbstring.c @@ -1584,7 +1584,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-- +<?php extension_loaded('mbstring') or die('skip mbstring not available'); ?> +--FILE-- +<?php +// 0 is a valid codepoint regardless of encoding +var_dump(mb_substitute_character(0)); +?> +--EXPECT-- +bool(true) |