Skip to content

Commit

Permalink
Fix #77827: preg_match does not ignore \r in regex flags
Browse files Browse the repository at this point in the history
  • Loading branch information
cmb69 committed Mar 31, 2019
1 parent 0dbb581 commit 88460c0
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
4 changes: 4 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down
1 change: 1 addition & 0 deletions ext/pcre/php_pcre.c
Original file line number Diff line number Diff line change
Expand Up @@ -486,6 +486,7 @@ PHPAPI pcre_cache_entry* pcre_get_compiled_regex_cache(zend_string *regex)

case ' ':
case '\n':
case '\r':
break;

default:
Expand Down
14 changes: 14 additions & 0 deletions ext/pcre/tests/bug77827.phpt
Original file line number Diff line number Diff line change
@@ -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===

0 comments on commit 88460c0

Please sign in to comment.