mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
Merge branch 'PHP-7.4'
This commit is contained in:
commit
21e631e473
6 changed files with 49 additions and 1 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue