ext/intl: fix bug introduced by 5455c3f

was meant to fix GH-12943.

Close GH-13001.
This commit is contained in:
David Carlier 2023-12-22 19:09:50 +00:00
parent 5d79c1b74d
commit 96ffe6ad7e

View file

@ -112,7 +112,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() || ((locale_len == 1 && locale_str[0] != 'C') && strlen(locale.getISO3Language()) == 0)) {
if (locale.isBogus() || ((locale_len == 1 && locale_str[0] != 'C') || (locale_len > 1 && strlen(locale.getISO3Language()) == 0))) {
goto error;
}