summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 81d172797b..67028cd64c 100644
--- a/NEWS
+++ b/NEWS
@@ -10,6 +10,10 @@ PHP NEWS
. Fixed bug #72175 (Impossibility of creating multiple connections to
Interbase with php 7.x). (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 4cdd8bf27c..2e827298a9 100644
--- a/ext/pcre/php_pcre.c
+++ b/ext/pcre/php_pcre.c
@@ -486,6 +486,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===