diff --git a/ext/intl/tests/bug68471.phpt b/ext/intl/tests/bug68471.phpt new file mode 100644 index 00000000000..3d0ad313a28 --- /dev/null +++ b/ext/intl/tests/bug68471.phpt @@ -0,0 +1,17 @@ +--TEST-- +Bug #68471 (IntlDateFormatter fails for "GMT+00:00" timezone) +--EXTENSIONS-- +intl +--FILE-- + +--EXPECT-- +object(IntlDateFormatter)#1 (0) { +} diff --git a/ext/intl/timezone/timezone_class.cpp b/ext/intl/timezone/timezone_class.cpp index 212821c77bb..64dec44f0eb 100644 --- a/ext/intl/timezone/timezone_class.cpp +++ b/ext/intl/timezone/timezone_class.cpp @@ -175,8 +175,7 @@ U_CFUNC TimeZone *timezone_process_timezone_argument(zval *zv_timezone, return timezone_convert_datetimezone(tzobj->type, tzobj, 0, outside_error, func); } else { - UnicodeString id, - gottenId; + UnicodeString id; UErrorCode status = U_ZERO_ERROR; /* outside_error may be NULL */ if (!try_convert_to_string(zv_timezone)) { 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); return NULL; } - if (timeZone->getID(gottenId) != id) { + if (*timeZone == TimeZone::getUnknown()) { spprintf(&message, 0, "%s: No such time zone: '%s'", func, Z_STRVAL_P(zv_timezone)); if (message) {