diff options
author | Christoph M. Becker <cmbecker69@gmx.de> | 2019-11-22 19:30:43 +0100 |
---|---|---|
committer | Christoph M. Becker <cmbecker69@gmx.de> | 2019-11-22 19:30:43 +0100 |
commit | e7e15450ef68c354b43cd027b1407942986dd171 (patch) | |
tree | a8ea6829a62b52fb3abdd91a0dab1a899069e0c0 /ext/pcre/php_pcre.c | |
parent | 501a72e354a0d93498411a982615e03a44c9327c (diff) | |
parent | cfb643ca2b1e03d0211b5bf089560c1dd3a41359 (diff) | |
download | php-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.c | 6 |
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 |