diff options
author | Nikita Popov <nikita.ppv@gmail.com> | 2019-10-06 10:07:57 +0200 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2019-10-06 10:07:57 +0200 |
commit | 21e631e4738055c0bbf1f8e768a2968f07290bc8 (patch) | |
tree | adab157e9f039a0154fa69e5007b5dd6d37adcba /ext/mbstring/php_mbregex.c | |
parent | e40da2661aca200ad078915ed1d2b916f0233e40 (diff) | |
parent | 6623e7ac51f0bafe85e013f9aed5340199e80c10 (diff) | |
download | php-git-21e631e4738055c0bbf1f8e768a2968f07290bc8.tar.gz |
Merge branch 'PHP-7.4'
Diffstat (limited to 'ext/mbstring/php_mbregex.c')
-rw-r--r-- | ext/mbstring/php_mbregex.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/ext/mbstring/php_mbregex.c b/ext/mbstring/php_mbregex.c index ca22bacb1a..887dc7df45 100644 --- a/ext/mbstring/php_mbregex.c +++ b/ext/mbstring/php_mbregex.c @@ -37,6 +37,7 @@ typedef void OnigMatchParam; #define onig_new_match_param() (NULL) #define onig_initialize_match_param(x) (void)(x) #define onig_set_match_stack_limit_size_of_match_param(x, y) +#define onig_set_retry_limit_in_match_of_match_param(x, y) #define onig_free_match_param(x) #define onig_search_with_param(reg, str, end, start, range, region, option, mp) \ onig_search(reg, str, end, start, range, region, option) @@ -872,6 +873,9 @@ static int _php_mb_onig_search(regex_t* reg, const OnigUChar* str, const OnigUCh if (!ZEND_LONG_UINT_OVFL(MBSTRG(regex_stack_limit))) { onig_set_match_stack_limit_size_of_match_param(mp, (unsigned int)MBSTRG(regex_stack_limit)); } + if (!ZEND_LONG_UINT_OVFL(MBSTRG(regex_retry_limit))) { + onig_set_retry_limit_in_match_of_match_param(mp, (unsigned int)MBSTRG(regex_retry_limit)); + } /* search */ err = onig_search_with_param(reg, str, end, start, range, region, option, mp); onig_free_match_param(mp); @@ -1360,9 +1364,12 @@ PHP_FUNCTION(mb_ereg_match) mp = onig_new_match_param(); onig_initialize_match_param(mp); - if(MBSTRG(regex_stack_limit) > 0 && MBSTRG(regex_stack_limit) < UINT_MAX) { + if (MBSTRG(regex_stack_limit) > 0 && MBSTRG(regex_stack_limit) < UINT_MAX) { onig_set_match_stack_limit_size_of_match_param(mp, (unsigned int)MBSTRG(regex_stack_limit)); } + if (MBSTRG(regex_retry_limit) > 0 && MBSTRG(regex_retry_limit) < UINT_MAX) { + onig_set_retry_limit_in_match_of_match_param(mp, (unsigned int)MBSTRG(regex_retry_limit)); + } /* match */ err = onig_match_with_param(re, (OnigUChar *)string, (OnigUChar *)(string + string_len), (OnigUChar *)string, NULL, 0, mp); onig_free_match_param(mp); |