summaryrefslogtreecommitdiff
path: root/ext/pcre/php_pcre.c
diff options
context:
space:
mode:
authorChristoph M. Becker <cmbecker69@gmx.de>2019-11-22 19:28:49 +0100
committerChristoph M. Becker <cmbecker69@gmx.de>2019-11-22 19:29:11 +0100
commitcfb643ca2b1e03d0211b5bf089560c1dd3a41359 (patch)
tree6169cf29765dfaaaec9e657cdcd9cb9a95756839 /ext/pcre/php_pcre.c
parent99b8e67615159fc600a615e1e97f2d1cf18f14cb (diff)
parente1da72bdf18aa3d413c5324bccfd8dc521c217e3 (diff)
downloadphp-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.c6
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