ext/intl: change when the locale is invalid for the 8.1/8.2 serie.

does not throws an exception as it's considered as a too string change,
but the code user still needs to double check.
This commit is contained in:
David Carlier 2023-10-30 13:42:50 +00:00
parent fe3a819e32
commit 0da1356c66
3 changed files with 13 additions and 9 deletions

View file

@ -113,8 +113,7 @@ static zend_result datefmt_ctor(INTERNAL_FUNCTION_PARAMETERS, zend_error_handlin
locale = Locale::createFromName(locale_str);
/* get*Name accessors being set does not preclude being bogus */
if (locale.isBogus() || strlen(locale.getISO3Language()) == 0) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, "datefmt_create: invalid locale", 0);
return FAILURE;
goto error;
}
/* process calendar */