diff options
author | Christoph M. Becker <cmbecker69@gmx.de> | 2019-11-22 19:28:49 +0100 |
---|---|---|
committer | Christoph M. Becker <cmbecker69@gmx.de> | 2019-11-22 19:29:11 +0100 |
commit | cfb643ca2b1e03d0211b5bf089560c1dd3a41359 (patch) | |
tree | 6169cf29765dfaaaec9e657cdcd9cb9a95756839 /ext/pcre/php_pcre.c | |
parent | 99b8e67615159fc600a615e1e97f2d1cf18f14cb (diff) | |
parent | e1da72bdf18aa3d413c5324bccfd8dc521c217e3 (diff) | |
download | php-git-cfb643ca2b1e03d0211b5bf089560c1dd3a41359.tar.gz |
Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
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 559836e679..15afc29778 100644 --- a/ext/pcre/php_pcre.c +++ b/ext/pcre/php_pcre.c @@ -1359,7 +1359,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 |