summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Peter Banyard <girgias@php.net>2020-04-03 21:28:07 +0200
committerGeorge Peter Banyard <girgias@php.net>2020-04-03 21:28:07 +0200
commit7a4261187091f5376107561577c0d444b2788b9c (patch)
tree761d17c26e999343250d3879fd6728be400c5137
parent37a179bd3cfdb7dae21a7d6b82229f4220b47d53 (diff)
parent1333b46d6dc0c293c1fd626803f91bc69743eb79 (diff)
downloadphp-git-7a4261187091f5376107561577c0d444b2788b9c.tar.gz
Merge branch 'PHP-7.3' into PHP-7.4
-rw-r--r--ext/mbstring/mbstring.c2
-rw-r--r--ext/mbstring/tests/bug79448.phpt11
2 files changed, 12 insertions, 1 deletions
diff --git a/ext/mbstring/mbstring.c b/ext/mbstring/mbstring.c
index 489299726d..0fc0eca638 100644
--- a/ext/mbstring/mbstring.c
+++ b/ext/mbstring/mbstring.c
@@ -2042,7 +2042,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)