Skip to content

Commit d5ff312

Browse files
committed
Update wording of warning message, and reinstate 'UTC' fallback for ctor
1 parent f87bbe2 commit d5ff312

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

ext/date/php_date.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -538,7 +538,7 @@ static char* guess_timezone(const timelib_tzdb *tzdb)
538538
}
539539

540540
if (!timelib_timezone_id_is_valid(DATEG(default_timezone), tzdb)) {
541-
php_error_docref(NULL, E_WARNING, "Invalid date.timezone value '%s'", DATEG(default_timezone));
541+
php_error_docref(NULL, E_WARNING, "UTC was used as timezone, because the date.timezone value '%s' is invalid", DATEG(default_timezone));
542542
return "UTC";
543543
}
544544

ext/date/tests/bug73239.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ try {
1111
?>
1212
--EXPECTF--
1313
Warning: ini_set(): Invalid date.timezone value 'dummy' in %sbug73239.php on line %d
14-
DateTime::__construct(): Invalid date.timezone value 'dummy', we selected the timezone 'UTC' for now.
14+
DateTime::__construct(): UTC was used as timezone, because the date.timezone value 'dummy' is invalid

ext/date/tests/date_default_timezone_get-4.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ date.timezone=Incorrect/Zone
77
echo date_default_timezone_get(), "\n";
88
?>
99
--EXPECTF--
10-
Warning: date_default_timezone_get(): Invalid date.timezone value 'Incorrect/Zone', we selected the timezone 'UTC' for now. in %sdate_default_timezone_get-4.php on line %d
10+
Warning: date_default_timezone_get(): UTC was used as timezone, because the date.timezone value 'Incorrect/Zone' is invalid in %sdate_default_timezone_get-4.php on line %d
1111
UTC

ext/intl/tests/dateformat_invalid_timezone.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ try {
1616
}
1717
?>
1818
--EXPECT--
19-
IntlDateFormatter::__construct(): Invalid date.timezone value 'Mars/Utopia_Planitia', we selected the timezone 'UTC' for now.
19+
IntlDateFormatter::__construct(): UTC was used as timezone, because the date.timezone value 'Mars/Utopia_Planitia' is invalid

0 commit comments

Comments
 (0)