You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if (SUCCESS==zend_get_configuration_directive("date.timezone", sizeof("date.timezone"), &ztz) &&Z_TYPE(ztz) ==IS_STRING&&Z_STRLEN(ztz) >0&&timelib_timezone_id_is_valid(Z_STRVAL(ztz), tzdb)) {
862
883
returnZ_STRVAL(ztz);
863
884
}
864
885
} elseif (*DATEG(default_timezone)) {
865
-
if (timelib_timezone_id_is_valid(DATEG(default_timezone), tzdb)) {
886
+
if (DATEG(timezone_valid) ==1) { // timezone already checked and validated
866
887
returnDATEG(default_timezone);
867
888
}
868
-
/* Invalid date.timezone value */
869
-
php_error_docref(NULLTSRMLS_CC, E_WARNING, "Invalid date.timezone value '%s', we selected the timezone 'UTC' for now.", DATEG(default_timezone));
870
-
} else {
871
-
/* No date.timezone value */
872
-
php_error_docref(NULLTSRMLS_CC, E_WARNING, DATE_TZ_ERRMSG"We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone.");
889
+
890
+
if (!timelib_timezone_id_is_valid(DATEG(default_timezone), tzdb)) {
891
+
php_error_docref(NULLTSRMLS_CC, E_WARNING, "Invalid date.timezone value '%s', we selected the timezone 'UTC' for now.", DATEG(default_timezone));
892
+
return"UTC";
893
+
}
894
+
895
+
DATEG(timezone_valid) =1;
896
+
returnDATEG(default_timezone);
873
897
}
874
898
/* Fallback to UTC */
899
+
php_error_docref(NULLTSRMLS_CC, E_WARNING, DATE_TZ_ERRMSG"We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone.");
0 commit comments