summaryrefslogtreecommitdiff
path: root/ext/pcre
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 /ext/pcre
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
Diffstat (limited to 'ext/pcre')
-rw-r--r--ext/pcre/php_pcre.c1
-rw-r--r--ext/pcre/tests/bug77827.phpt14
2 files changed, 15 insertions, 0 deletions
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===