From: Stanislav Malyshev Date: Mon, 1 Apr 2019 07:05:36 +0000 (-0700) Subject: Merge branch 'PHP-7.3' into PHP-7.4 X-Git-Tag: php-7.4.0alpha1~619 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=077ce33aa98d3c428c968091002cdbd559a8fc58;p=php Merge branch 'PHP-7.3' into PHP-7.4 * PHP-7.3: Update NEWS & UPGRADING Add fallbacks for older oniguruma versions Add mbstring.regex_stack_limit to php.ini-* Implement RF bug #72777 - ensure stack limits on mbstring functions. --- 077ce33aa98d3c428c968091002cdbd559a8fc58 diff --cc ext/mbstring/mbstring.c index cf0b08be6e,28ea4bd056..d8248aac5d --- a/ext/mbstring/mbstring.c +++ b/ext/mbstring/mbstring.c @@@ -56,15 -56,29 +56,26 @@@ #include "mb_gpc.h" #if HAVE_MBREGEX -#include "php_mbregex.h" -#endif - -#include "zend_multibyte.h" - -#if HAVE_ONIG -#include "php_onig_compat.h" -#include -#undef UChar +# include "php_mbregex.h" +# include "php_onig_compat.h" +# include +# 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) ++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) ++onig_match(re, str, end, at, region, option) + #endif -#elif HAVE_PCRE || HAVE_BUNDLED_PCRE -#include "ext/pcre/php_pcre.h" +#else +# include "ext/pcre/php_pcre.h" #endif + +#include "zend_multibyte.h" /* }}} */ #if HAVE_MBSTRING diff --cc ext/mbstring/mbstring.h index 7321525064,29fe1e97e2..cd882c1c03 --- a/ext/mbstring/mbstring.h +++ b/ext/mbstring/mbstring.h @@@ -165,8 -166,9 +165,9 @@@ ZEND_BEGIN_MODULE_GLOBALS(mbstring void *http_output_conv_mimetypes; #if HAVE_MBREGEX struct _zend_mb_regex_globals *mb_regex_globals; + zend_long regex_stack_limit; #endif - char *last_used_encoding_name; + zend_string *last_used_encoding_name; const mbfl_encoding *last_used_encoding; ZEND_END_MODULE_GLOBALS(mbstring)