diff options
author | Nikita Popov <nikita.ppv@gmail.com> | 2021-03-15 14:48:09 +0100 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2021-03-15 14:48:09 +0100 |
commit | b82b85709d8017b94a34570bbb694a97ab26e71a (patch) | |
tree | 44a7bdc01bf82ebec21c286b56125bc2d99e7c6e /ext/pcre/php_pcre.c | |
parent | 5604c2d05c524ecb3f4db4fa909f1da7168d4eb6 (diff) | |
parent | 50254de0a2cc63570a5caf7666151a77e7bd0b7a (diff) | |
download | php-git-b82b85709d8017b94a34570bbb694a97ab26e71a.tar.gz |
Merge branch 'PHP-8.0'
* PHP-8.0:
Fix bug #80866
Diffstat (limited to 'ext/pcre/php_pcre.c')
-rw-r--r-- | ext/pcre/php_pcre.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/ext/pcre/php_pcre.c b/ext/pcre/php_pcre.c index e9d8f6869d..08c3381cde 100644 --- a/ext/pcre/php_pcre.c +++ b/ext/pcre/php_pcre.c @@ -2640,6 +2640,10 @@ matched: the match again at the same point. If this fails (picked up above) we advance to the next character. */ if (start_offset == offsets[0]) { + /* Get next piece if no limit or limit not yet reached and something matched*/ + if (limit_val != -1 && limit_val <= 1) { + break; + } count = pcre2_match(pce->re, (PCRE2_SPTR)subject, ZSTR_LEN(subject_str), start_offset, PCRE2_NO_UTF_CHECK | PCRE2_NOTEMPTY_ATSTART | PCRE2_ANCHORED, match_data, mctx); if (count >= 0) { |