1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

Merge branch 'PHP-8.2' into PHP-8.3

This commit is contained in:
David Carlier
2023-12-22 17:26:20 +00:00
3 changed files with 20 additions and 1 deletions

4
NEWS
View File

@@ -26,6 +26,10 @@ PHP NEWS
(Jakub Zelenka)
. Fixed bug GH-12905 (FFI::new interacts badly with observers). (nielsdos)
- Intl:
. Fixed GH-12943 (IntlDateFormatter::__construct accepts 'C' as valid locale).
(David Carlier)
- Hash:
. Fixed bug GH-12936 (hash() function hangs endlessly if using sha512 on
strings >= 4GiB). (nielsdos)

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

View 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"