From: Anatol Belski Date: Wed, 12 Oct 2016 18:52:46 +0000 (+0200) Subject: update len in fallback cases X-Git-Tag: php-7.1.0RC4~21^2~18 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=58b18892bf3db0adf2a01f92adb4c907700fbbdd;p=php update len in fallback cases --- diff --git a/ext/intl/locale/locale_methods.c b/ext/intl/locale/locale_methods.c index eaf113a97e..18a051fe20 100644 --- a/ext/intl/locale/locale_methods.c +++ b/ext/intl/locale/locale_methods.c @@ -405,6 +405,7 @@ static void get_icu_value_src_php( char* tag_name, INTERNAL_FUNCTION_PARAMETERS) if(loc_name_len == 0) { loc_name = intl_locale_get_default(); + loc_name_len = strlen(loc_name); } INTL_CHECK_LOCALE_LEN(loc_name_len); @@ -1169,6 +1170,7 @@ PHP_FUNCTION(locale_get_all_variants) if(loc_name_len == 0) { loc_name = intl_locale_get_default(); + loc_name_len = strlen(loc_name); } INTL_CHECK_LOCALE_LEN(loc_name_len); @@ -1274,6 +1276,7 @@ PHP_FUNCTION(locale_filter_matches) if(loc_range_len == 0) { loc_range = intl_locale_get_default(); + loc_range_len = strlen(loc_range); } if( strcmp(loc_range,"*")==0){ @@ -1557,8 +1560,10 @@ PHP_FUNCTION(locale_lookup) if(loc_range_len == 0) { if(fallback_loc_str) { loc_range = ZSTR_VAL(fallback_loc_str); + loc_range_len = ZSTR_LEN(fallback_loc_str); } else { loc_range = intl_locale_get_default(); + loc_range_len = strlen(loc_range); } }