summaryrefslogtreecommitdiff
path: root/ext/pcre/php_pcre.c
diff options
context:
space:
mode:
authorChristoph M. Becker <cmbecker69@gmx.de>2019-11-22 19:30:43 +0100
committerChristoph M. Becker <cmbecker69@gmx.de>2019-11-22 19:30:43 +0100
commite7e15450ef68c354b43cd027b1407942986dd171 (patch)
treea8ea6829a62b52fb3abdd91a0dab1a899069e0c0 /ext/pcre/php_pcre.c
parent501a72e354a0d93498411a982615e03a44c9327c (diff)
parentcfb643ca2b1e03d0211b5bf089560c1dd3a41359 (diff)
downloadphp-git-e7e15450ef68c354b43cd027b1407942986dd171.tar.gz
Merge branch 'PHP-7.4'
* PHP-7.4: Fix #78853: preg_match() may return integer > 1
Diffstat (limited to 'ext/pcre/php_pcre.c')
-rw-r--r--ext/pcre/php_pcre.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/ext/pcre/php_pcre.c b/ext/pcre/php_pcre.c
index d3c84aef9f..f5f1d6f70e 100644
--- a/ext/pcre/php_pcre.c
+++ b/ext/pcre/php_pcre.c
@@ -1338,7 +1338,11 @@ matched:
count = pcre2_match(pce->re, (PCRE2_SPTR)subject, subject_len, start_offset2,
PCRE2_NO_UTF_CHECK | PCRE2_NOTEMPTY_ATSTART | PCRE2_ANCHORED, match_data, mctx);
if (count >= 0) {
- goto matched;
+ if (global) {
+ goto matched;
+ } else {
+ break;
+ }
} else if (count == PCRE2_ERROR_NOMATCH) {
/* If we previously set PCRE2_NOTEMPTY_ATSTART after a null match,
this is not necessarily the end. We need to advance