Skip to content

Commit 7e8f898

Browse files
committed
Update wording of warning message, and reinstate 'UTC' fallback for ctor
1 parent 0fa9567 commit 7e8f898

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
@@ -519,7 +519,7 @@ static char* guess_timezone(const timelib_tzdb *tzdb)
519519
}
520520

521521
if (!timelib_timezone_id_is_valid(DATEG(default_timezone), tzdb)) {
522-
php_error_docref(NULL, E_WARNING, "Invalid date.timezone value '%s'", DATEG(default_timezone));
522+
php_error_docref(NULL, E_WARNING, "UTC was used as timezone, because the date.timezone value '%s' is invalid", DATEG(default_timezone));
523523
return "UTC";
524524
}
525525

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
@@ -15,4 +15,4 @@ try {
1515
}
1616
?>
1717
--EXPECT--
18-
IntlDateFormatter::__construct(): Invalid date.timezone value 'Mars/Utopia_Planitia', we selected the timezone 'UTC' for now.
18+
IntlDateFormatter::__construct(): UTC was used as timezone, because the date.timezone value 'Mars/Utopia_Planitia' is invalid

0 commit comments

Comments
 (0)