summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph M. Becker <cmbecker69@gmx.de>2019-03-31 13:32:31 +0200
committerChristoph M. Becker <cmbecker69@gmx.de>2019-03-31 13:33:21 +0200
commitd8b7728b0e1306ccdfc346beaee8091abd930c03 (patch)
tree26b4e4b08b54e7c48eb583e2f02a59bd8827a1c2
parenta2c87c7f29929760e75e0357388dd39b9c7b42f7 (diff)
parent88460c017a06ce8865f1adcc8f70e511cf776e06 (diff)
downloadphp-git-d8b7728b0e1306ccdfc346beaee8091abd930c03.tar.gz
Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2: Fix #77827: preg_match does not ignore \r in regex flags
-rw-r--r--NEWS4
-rw-r--r--ext/pcre/php_pcre.c1
-rw-r--r--ext/pcre/tests/bug77827.phpt14
3 files changed, 19 insertions, 0 deletions
diff --git a/NEWS b/NEWS
index 2ca20ad97c..207338cf61 100644
--- a/NEWS
+++ b/NEWS
@@ -14,6 +14,10 @@ PHP NEWS
. Fixed bug #77773 (Unbuffered queries leak memory - MySQLi / mysqlnd).
(Nikita)
+- PCRE:
+ . Fixed bug #77827 (preg_match does not ignore \r in regex flags). (requinix,
+ cmb)
+
- phpdbg:
. Fixed bug #76801 (too many open files). (alekitto)
. Fixed bug #77800 (phpdbg segfaults on listing some conditional breakpoints).
diff --git a/ext/pcre/php_pcre.c b/ext/pcre/php_pcre.c
index db469a576f..637195b59c 100644
--- a/ext/pcre/php_pcre.c
+++ b/ext/pcre/php_pcre.c
@@ -695,6 +695,7 @@ PHPAPI pcre_cache_entry* pcre_get_compiled_regex_cache(zend_string *regex)
case ' ':
case '\n':
+ case '\r':
break;
default:
diff --git a/ext/pcre/tests/bug77827.phpt b/ext/pcre/tests/bug77827.phpt
new file mode 100644
index 0000000000..c8f8c7a16a
--- /dev/null
+++ b/ext/pcre/tests/bug77827.phpt
@@ -0,0 +1,14 @@
+--TEST--
+Bug #77827 (preg_match does not ignore \r in regex flags)
+--FILE--
+<?php
+var_dump(
+ preg_match("/foo/i\r", 'FOO'),
+ preg_last_error()
+);
+?>
+===DONE===
+--EXPECT--
+int(1)
+int(0)
+===DONE===