diff options
| author | Stanislav Malyshev <stas@php.net> | 2019-03-30 14:52:04 -0700 |
|---|---|---|
| committer | Stanislav Malyshev <stas@php.net> | 2019-03-30 23:18:33 -0700 |
| commit | e12c069d33fef2e0b2a8009e1cd4bc4fc2206e67 (patch) | |
| tree | 79f011eede267ff5b5dbc3b4b4d28e5c6381c968 /ext/mbstring/mbstring.c | |
| parent | bc4cb277d3ddaecee8285b98d248380b454edbfd (diff) | |
| download | php-git-e12c069d33fef2e0b2a8009e1cd4bc4fc2206e67.tar.gz | |
Add fallbacks for older oniguruma versions
Diffstat (limited to 'ext/mbstring/mbstring.c')
| -rw-r--r-- | ext/mbstring/mbstring.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/ext/mbstring/mbstring.c b/ext/mbstring/mbstring.c index 36b6c478b8..28ea4bd056 100644 --- a/ext/mbstring/mbstring.c +++ b/ext/mbstring/mbstring.c @@ -65,6 +65,17 @@ #include "php_onig_compat.h" #include <oniguruma.h> #undef UChar +#if ONIGURUMA_VERSION_INT < 60800 +typedef void OnigMatchParam; +#define onig_new_match_param() (NULL) +#define onig_initialize_match_param(x) +#define onig_set_match_stack_limit_size_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) +#define onig_match_with_param(re, str, end, at, region, option, mp) \ + onig_match(re, str, end, at, region, option) +#endif #elif HAVE_PCRE || HAVE_BUNDLED_PCRE #include "ext/pcre/php_pcre.h" #endif @@ -1030,7 +1041,7 @@ static int _php_mb_match_regex(void *opaque, const char *str, size_t str_len) OnigMatchParam *mp = onig_new_match_param(); int err; onig_initialize_match_param(mp); - if(MBSTRG(regex_stack_limit) > 0 && MBSTRG(regex_stack_limit) < UINT_MAX) { + 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)); } /* search */ |
