mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4: Fix #68471: IntlDateFormatter fails for "GMT+00:00" timezone
This commit is contained in:
commit
1bf2b04b26
3 changed files with 22 additions and 3 deletions
1
NEWS
1
NEWS
|
@ -13,6 +13,7 @@ PHP NEWS
|
||||||
- Intl:
|
- Intl:
|
||||||
. Fixed bug #72809 (Locale::lookup() wrong result with canonicalize option).
|
. Fixed bug #72809 (Locale::lookup() wrong result with canonicalize option).
|
||||||
(cmb)
|
(cmb)
|
||||||
|
. Fixed bug #68471 (IntlDateFormatter fails for "GMT+00:00" timezone). (cmb)
|
||||||
|
|
||||||
- PCRE:
|
- PCRE:
|
||||||
. Fixed bug #81101 (PCRE2 10.37 shows unexpected result). (Anatol)
|
. Fixed bug #81101 (PCRE2 10.37 shows unexpected result). (Anatol)
|
||||||
|
|
19
ext/intl/tests/bug68471.phpt
Normal file
19
ext/intl/tests/bug68471.phpt
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
--TEST--
|
||||||
|
Bug #68471 (IntlDateFormatter fails for "GMT+00:00" timezone)
|
||||||
|
--SKIPIF--
|
||||||
|
<?php
|
||||||
|
if (!extension_loaded('intl')) die("sikp intl extension not available");
|
||||||
|
?>
|
||||||
|
--FILE--
|
||||||
|
<?php
|
||||||
|
$formatter = new IntlDateFormatter(
|
||||||
|
'fr_FR',
|
||||||
|
IntlDateFormatter::NONE,
|
||||||
|
IntlDateFormatter::NONE,
|
||||||
|
"GMT+00:00"
|
||||||
|
);
|
||||||
|
var_dump($formatter);
|
||||||
|
?>
|
||||||
|
--EXPECT--
|
||||||
|
object(IntlDateFormatter)#1 (0) {
|
||||||
|
}
|
|
@ -175,8 +175,7 @@ U_CFUNC TimeZone *timezone_process_timezone_argument(zval *zv_timezone,
|
||||||
return timezone_convert_datetimezone(tzobj->type, tzobj, 0,
|
return timezone_convert_datetimezone(tzobj->type, tzobj, 0,
|
||||||
outside_error, func);
|
outside_error, func);
|
||||||
} else {
|
} else {
|
||||||
UnicodeString id,
|
UnicodeString id;
|
||||||
gottenId;
|
|
||||||
UErrorCode status = U_ZERO_ERROR; /* outside_error may be NULL */
|
UErrorCode status = U_ZERO_ERROR; /* outside_error may be NULL */
|
||||||
if (!try_convert_to_string(zv_timezone)) {
|
if (!try_convert_to_string(zv_timezone)) {
|
||||||
zval_ptr_dtor_str(&local_zv_tz);
|
zval_ptr_dtor_str(&local_zv_tz);
|
||||||
|
@ -203,7 +202,7 @@ U_CFUNC TimeZone *timezone_process_timezone_argument(zval *zv_timezone,
|
||||||
zval_ptr_dtor_str(&local_zv_tz);
|
zval_ptr_dtor_str(&local_zv_tz);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
if (timeZone->getID(gottenId) != id) {
|
if (*timeZone == TimeZone::getUnknown()) {
|
||||||
spprintf(&message, 0, "%s: No such time zone: '%s'",
|
spprintf(&message, 0, "%s: No such time zone: '%s'",
|
||||||
func, Z_STRVAL_P(zv_timezone));
|
func, Z_STRVAL_P(zv_timezone));
|
||||||
if (message) {
|
if (message) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue