mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
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:
parent
fe3a819e32
commit
0da1356c66
3 changed files with 13 additions and 9 deletions
4
NEWS
4
NEWS
|
@ -19,6 +19,10 @@ PHP NEWS
|
||||||
. Fixed bug GH-12232 (FPM: segfault dynamically loading extension without
|
. Fixed bug GH-12232 (FPM: segfault dynamically loading extension without
|
||||||
opcache). (Jakub Zelenka)
|
opcache). (Jakub Zelenka)
|
||||||
|
|
||||||
|
- Intl:
|
||||||
|
. Removed the BC break on IntlDateFormatter::construct which threw an
|
||||||
|
exception with an invalid locale. (David Carlier)
|
||||||
|
|
||||||
- Opcache:
|
- Opcache:
|
||||||
. Added warning when JIT cannot be enabled. (danog)
|
. Added warning when JIT cannot be enabled. (danog)
|
||||||
. Fixed bug GH-8143 (Crashes in zend_accel_inheritance_cache_find since
|
. Fixed bug GH-8143 (Crashes in zend_accel_inheritance_cache_find since
|
||||||
|
|
|
@ -113,8 +113,7 @@ static zend_result datefmt_ctor(INTERNAL_FUNCTION_PARAMETERS, zend_error_handlin
|
||||||
locale = Locale::createFromName(locale_str);
|
locale = Locale::createFromName(locale_str);
|
||||||
/* get*Name accessors being set does not preclude being bogus */
|
/* get*Name accessors being set does not preclude being bogus */
|
||||||
if (locale.isBogus() || strlen(locale.getISO3Language()) == 0) {
|
if (locale.isBogus() || strlen(locale.getISO3Language()) == 0) {
|
||||||
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, "datefmt_create: invalid locale", 0);
|
goto error;
|
||||||
return FAILURE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* process calendar */
|
/* process calendar */
|
||||||
|
|
|
@ -5,17 +5,18 @@ intl
|
||||||
--FILE--
|
--FILE--
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
try {
|
var_dump(new IntlDateFormatter(
|
||||||
new IntlDateFormatter(
|
|
||||||
'xx',
|
'xx',
|
||||||
IntlDateFormatter::FULL,
|
IntlDateFormatter::FULL,
|
||||||
IntlDateFormatter::FULL,
|
IntlDateFormatter::FULL,
|
||||||
null,
|
null,
|
||||||
null,
|
null,
|
||||||
'w'
|
'w'
|
||||||
);
|
));
|
||||||
} catch (\IntlException $e) {
|
Locale::setDefault('xx');
|
||||||
echo $e->getMessage();
|
var_dump(new IntlDateFormatter(Locale::getDefault()));
|
||||||
}
|
|
||||||
--EXPECT--
|
--EXPECT--
|
||||||
datefmt_create: invalid locale: U_ILLEGAL_ARGUMENT_ERROR
|
object(IntlDateFormatter)#1 (0) {
|
||||||
|
}
|
||||||
|
object(IntlDateFormatter)#1 (0) {
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue