|
65 | 65 | #include "php_onig_compat.h"
|
66 | 66 | #include <oniguruma.h>
|
67 | 67 | #undef UChar
|
| 68 | +#if ONIGURUMA_VERSION_INT < 60800 |
| 69 | +typedef void OnigMatchParam; |
| 70 | +#define onig_new_match_param() (NULL) |
| 71 | +#define onig_initialize_match_param(x) |
| 72 | +#define onig_set_match_stack_limit_size_of_match_param(x, y) |
| 73 | +#define onig_free_match_param(x) |
| 74 | +#define onig_search_with_param(reg, str, end, start, range, region, option, mp) \ |
| 75 | + onig_search(reg, str, end, start, range, region, option) |
| 76 | +#define onig_match_with_param(re, str, end, at, region, option, mp) \ |
| 77 | + onig_match(re, str, end, at, region, option) |
| 78 | +#endif |
68 | 79 | #elif HAVE_PCRE || HAVE_BUNDLED_PCRE
|
69 | 80 | #include "ext/pcre/php_pcre.h"
|
70 | 81 | #endif
|
@@ -1030,7 +1041,7 @@ static int _php_mb_match_regex(void *opaque, const char *str, size_t str_len)
|
1030 | 1041 | OnigMatchParam *mp = onig_new_match_param();
|
1031 | 1042 | int err;
|
1032 | 1043 | onig_initialize_match_param(mp);
|
1033 |
| - if(MBSTRG(regex_stack_limit) > 0 && MBSTRG(regex_stack_limit) < UINT_MAX) { |
| 1044 | + if (!ZEND_LONG_UINT_OVFL(MBSTRG(regex_stack_limit))) { |
1034 | 1045 | onig_set_match_stack_limit_size_of_match_param(mp, (unsigned int)MBSTRG(regex_stack_limit));
|
1035 | 1046 | }
|
1036 | 1047 | /* search */
|
|
0 commit comments