Remove no longer used 'timezone_valid' flag

This commit is contained in:
Derick Rethans 2022-05-29 17:30:29 +01:00
parent 6770158d47
commit c85fcbc218
2 changed files with 0 additions and 16 deletions

View file

@ -342,7 +342,6 @@ static PHP_GINIT_FUNCTION(date)
date_globals->default_timezone = NULL;
date_globals->timezone = NULL;
date_globals->tzcache = NULL;
date_globals->timezone_valid = 0;
}
/* }}} */
@ -478,8 +477,6 @@ timelib_tzinfo *php_date_parse_tzfile_wrapper(const char *formal_tzname, const t
/* {{{ static PHP_INI_MH(OnUpdate_date_timezone) */
static PHP_INI_MH(OnUpdate_date_timezone)
{
DATEG(timezone_valid) = 0;
if (new_value && ZSTR_VAL(new_value) && !timelib_timezone_id_is_valid(ZSTR_VAL(new_value), DATE_TIMEZONEDB)) {
php_error_docref(NULL, E_WARNING, "Invalid date.timezone value '%s', using 'UTC' instead", ZSTR_VAL(new_value));
return FAILURE;
@ -489,8 +486,6 @@ static PHP_INI_MH(OnUpdate_date_timezone)
return FAILURE;
}
DATEG(timezone_valid) = 1;
return SUCCESS;
}
/* }}} */
@ -512,16 +507,6 @@ static char* guess_timezone(const timelib_tzdb *tzdb)
return Z_STRVAL_P(ztz);
}
} else if (*DATEG(default_timezone)) {
if (DATEG(timezone_valid) == 1) {
return DATEG(default_timezone);
}
if (!timelib_timezone_id_is_valid(DATEG(default_timezone), tzdb)) {
php_error_docref(NULL, E_WARNING, "UTC was used as timezone, because the date.timezone value '%s' is invalid", DATEG(default_timezone));
return "UTC";
}
DATEG(timezone_valid) = 1;
return DATEG(default_timezone);
}
/* Fallback to UTC */

View file

@ -108,7 +108,6 @@ ZEND_BEGIN_MODULE_GLOBALS(date)
char *timezone;
HashTable *tzcache;
timelib_error_container *last_errors;
int timezone_valid;
ZEND_END_MODULE_GLOBALS(date)
#define DATEG(v) ZEND_MODULE_GLOBALS_ACCESSOR(date, v)