Skip to content

Commit d8b7728

Browse files
committed
Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2: Fix #77827: preg_match does not ignore \r in regex flags
2 parents a2c87c7 + 88460c0 commit d8b7728

File tree

3 files changed

+19
-0
lines changed

3 files changed

+19
-0
lines changed

NEWS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ PHP NEWS
1414
. Fixed bug #77773 (Unbuffered queries leak memory - MySQLi / mysqlnd).
1515
(Nikita)
1616

17+
- PCRE:
18+
. Fixed bug #77827 (preg_match does not ignore \r in regex flags). (requinix,
19+
cmb)
20+
1721
- phpdbg:
1822
. Fixed bug #76801 (too many open files). (alekitto)
1923
. Fixed bug #77800 (phpdbg segfaults on listing some conditional breakpoints).

ext/pcre/php_pcre.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -695,6 +695,7 @@ PHPAPI pcre_cache_entry* pcre_get_compiled_regex_cache(zend_string *regex)
695695

696696
case ' ':
697697
case '\n':
698+
case '\r':
698699
break;
699700

700701
default:

ext/pcre/tests/bug77827.phpt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
--TEST--
2+
Bug #77827 (preg_match does not ignore \r in regex flags)
3+
--FILE--
4+
<?php
5+
var_dump(
6+
preg_match("/foo/i\r", 'FOO'),
7+
preg_last_error()
8+
);
9+
?>
10+
===DONE===
11+
--EXPECT--
12+
int(1)
13+
int(0)
14+
===DONE===

0 commit comments

Comments
 (0)