mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
Fix GH-12727: NumberFormatter constructor throws an exception on invalid locale.
Also re-establishing exception throwing on IntlDateFormatter constructor overwritten by accident most likely so postponing it for next major release. Close GH-12868
This commit is contained in:
parent
d751e61504
commit
683e787860
7 changed files with 57 additions and 18 deletions
|
@ -113,7 +113,8 @@ 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) {
|
||||
goto error;
|
||||
zend_argument_value_error(1, "\"%s\" is invalid", locale_str);
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
/* process calendar */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue