@@ -342,7 +342,6 @@ static PHP_GINIT_FUNCTION(date)
342
342
date_globals -> default_timezone = NULL ;
343
343
date_globals -> timezone = NULL ;
344
344
date_globals -> tzcache = NULL ;
345
- date_globals -> timezone_valid = 0 ;
346
345
}
347
346
/* }}} */
348
347
@@ -478,8 +477,6 @@ timelib_tzinfo *php_date_parse_tzfile_wrapper(const char *formal_tzname, const t
478
477
/* {{{ static PHP_INI_MH(OnUpdate_date_timezone) */
479
478
static PHP_INI_MH (OnUpdate_date_timezone )
480
479
{
481
- DATEG (timezone_valid ) = 0 ;
482
-
483
480
if (new_value && ZSTR_VAL (new_value ) && !timelib_timezone_id_is_valid (ZSTR_VAL (new_value ), DATE_TIMEZONEDB )) {
484
481
php_error_docref (NULL , E_WARNING , "Invalid date.timezone value '%s', using 'UTC' instead" , ZSTR_VAL (new_value ));
485
482
return FAILURE ;
@@ -489,8 +486,6 @@ static PHP_INI_MH(OnUpdate_date_timezone)
489
486
return FAILURE ;
490
487
}
491
488
492
- DATEG (timezone_valid ) = 1 ;
493
-
494
489
return SUCCESS ;
495
490
}
496
491
/* }}} */
@@ -512,16 +507,6 @@ static char* guess_timezone(const timelib_tzdb *tzdb)
512
507
return Z_STRVAL_P (ztz );
513
508
}
514
509
} else if (* DATEG (default_timezone )) {
515
- if (DATEG (timezone_valid ) == 1 ) {
516
- return DATEG (default_timezone );
517
- }
518
-
519
- if (!timelib_timezone_id_is_valid (DATEG (default_timezone ), tzdb )) {
520
- php_error_docref (NULL , E_WARNING , "UTC was used as timezone, because the date.timezone value '%s' is invalid" , DATEG (default_timezone ));
521
- return "UTC" ;
522
- }
523
-
524
- DATEG (timezone_valid ) = 1 ;
525
510
return DATEG (default_timezone );
526
511
}
527
512
/* Fallback to UTC */
0 commit comments