Update wording of warning message, and reinstate 'UTC' fallback for ctor

This commit is contained in:
Derick Rethans 2022-05-27 10:19:08 +01:00
parent b3c6b540a1
commit e0d21297fe
4 changed files with 4 additions and 4 deletions

View File

@ -519,7 +519,7 @@ static char* guess_timezone(const timelib_tzdb *tzdb)
}
if (!timelib_timezone_id_is_valid(DATEG(default_timezone), tzdb)) {
php_error_docref(NULL, E_WARNING, "Invalid date.timezone value '%s'", DATEG(default_timezone));
php_error_docref(NULL, E_WARNING, "UTC was used as timezone, because the date.timezone value '%s' is invalid", DATEG(default_timezone));
return "UTC";
}

View File

@ -11,4 +11,4 @@ try {
?>
--EXPECTF--
Warning: ini_set(): Invalid date.timezone value 'dummy' in %sbug73239.php on line %d
DateTime::__construct(): Invalid date.timezone value 'dummy', we selected the timezone 'UTC' for now.
DateTime::__construct(): UTC was used as timezone, because the date.timezone value 'dummy' is invalid

View File

@ -7,5 +7,5 @@ date.timezone=Incorrect/Zone
echo date_default_timezone_get(), "\n";
?>
--EXPECTF--
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
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
UTC

View File

@ -15,4 +15,4 @@ try {
}
?>
--EXPECT--
IntlDateFormatter::__construct(): Invalid date.timezone value 'Mars/Utopia_Planitia', we selected the timezone 'UTC' for now.
IntlDateFormatter::__construct(): UTC was used as timezone, because the date.timezone value 'Mars/Utopia_Planitia' is invalid