Skip to content

Commit c85fcbc

Browse files
committed
Remove no longer used 'timezone_valid' flag
1 parent 6770158 commit c85fcbc

File tree

2 files changed

+0
-16
lines changed

2 files changed

+0
-16
lines changed

ext/date/php_date.c

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,6 @@ static PHP_GINIT_FUNCTION(date)
342342
date_globals->default_timezone = NULL;
343343
date_globals->timezone = NULL;
344344
date_globals->tzcache = NULL;
345-
date_globals->timezone_valid = 0;
346345
}
347346
/* }}} */
348347

@@ -478,8 +477,6 @@ timelib_tzinfo *php_date_parse_tzfile_wrapper(const char *formal_tzname, const t
478477
/* {{{ static PHP_INI_MH(OnUpdate_date_timezone) */
479478
static PHP_INI_MH(OnUpdate_date_timezone)
480479
{
481-
DATEG(timezone_valid) = 0;
482-
483480
if (new_value && ZSTR_VAL(new_value) && !timelib_timezone_id_is_valid(ZSTR_VAL(new_value), DATE_TIMEZONEDB)) {
484481
php_error_docref(NULL, E_WARNING, "Invalid date.timezone value '%s', using 'UTC' instead", ZSTR_VAL(new_value));
485482
return FAILURE;
@@ -489,8 +486,6 @@ static PHP_INI_MH(OnUpdate_date_timezone)
489486
return FAILURE;
490487
}
491488

492-
DATEG(timezone_valid) = 1;
493-
494489
return SUCCESS;
495490
}
496491
/* }}} */
@@ -512,16 +507,6 @@ static char* guess_timezone(const timelib_tzdb *tzdb)
512507
return Z_STRVAL_P(ztz);
513508
}
514509
} 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;
525510
return DATEG(default_timezone);
526511
}
527512
/* Fallback to UTC */

ext/date/php_date.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,6 @@ ZEND_BEGIN_MODULE_GLOBALS(date)
108108
char *timezone;
109109
HashTable *tzcache;
110110
timelib_error_container *last_errors;
111-
int timezone_valid;
112111
ZEND_END_MODULE_GLOBALS(date)
113112

114113
#define DATEG(v) ZEND_MODULE_GLOBALS_ACCESSOR(date, v)

0 commit comments

Comments
 (0)