mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
Merge branch 'PHP-8.3'
This commit is contained in:
commit
5455c3fc01
2 changed files with 17 additions and 2 deletions
|
@ -112,7 +112,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() || ((locale_len == 1 && locale_str[0] != 'C') && strlen(locale.getISO3Language()) == 0)) {
|
||||||
zend_argument_value_error(1, "\"%s\" is invalid", locale_str);
|
zend_argument_value_error(1, "\"%s\" is invalid", locale_str);
|
||||||
return FAILURE;
|
return FAILURE;
|
||||||
}
|
}
|
||||||
|
|
15
ext/intl/tests/gh12943.phpt
Normal file
15
ext/intl/tests/gh12943.phpt
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
--TEST--
|
||||||
|
GitHub #12943 IntlDateFormatter::locale accepting "C".
|
||||||
|
--EXTENSIONS--
|
||||||
|
intl
|
||||||
|
--FILE--
|
||||||
|
<?php
|
||||||
|
|
||||||
|
$fmt = new IntlDateFormatter(
|
||||||
|
'C',
|
||||||
|
IntlDateFormatter::FULL,
|
||||||
|
IntlDateFormatter::FULL,
|
||||||
|
);
|
||||||
|
var_dump($fmt->getLocale(ULOC_VALID_LOCALE));
|
||||||
|
--EXPECTF--
|
||||||
|
string(%d) "%s"
|
Loading…
Add table
Add a link
Reference in a new issue