We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ee21657 commit 1333b46Copy full SHA for 1333b46
ext/mbstring/mbstring.c
@@ -2038,7 +2038,7 @@ PHP_FUNCTION(mb_detect_order)
2038
2039
static inline int php_mb_check_code_point(zend_long cp)
2040
{
2041
- if (cp <= 0 || cp >= 0x110000) {
+ if (cp < 0 || cp >= 0x110000) {
2042
/* Out of Unicode range */
2043
return 0;
2044
}
ext/mbstring/tests/bug79448.phpt
@@ -0,0 +1,11 @@
1
+--TEST--
2
+Bug #79448 0 is a valid Unicode codepoint, but mb_substitute_character(0) fails
3
+--SKIPIF--
4
+<?php extension_loaded('mbstring') or die('skip mbstring not available'); ?>
5
+--FILE--
6
+<?php
7
+// 0 is a valid codepoint regardless of encoding
8
+var_dump(mb_substitute_character(0));
9
+?>
10
+--EXPECT--
11
+bool(true)
0 commit comments