@@ -846,7 +846,7 @@ timelib_tzinfo *php_date_parse_tzfile_wrapper(char *formal_tzname, const timelib
846
846
}
847
847
/* }}} */
848
848
849
- // created this callback method to check the date.timezone only when changed, to increase performance and error on an ini_set line
849
+ /* Callback to check the date.timezone only when changed increases performance */
850
850
/* {{{ static PHP_INI_MH(OnUpdate_date_timezone) */
851
851
static PHP_INI_MH (OnUpdate_date_timezone )
852
852
{
@@ -871,19 +871,20 @@ static PHP_INI_MH(OnUpdate_date_timezone)
871
871
static char * guess_timezone (const timelib_tzdb * tzdb TSRMLS_DC )
872
872
{
873
873
/* Checking configure timezone */
874
- if (DATEG (timezone ) && strlen (DATEG (timezone )) > 0 ) {
874
+ if (DATEG (timezone ) && ( strlen (DATEG (timezone ) )) > 0 ) {
875
875
return DATEG (timezone );
876
876
}
877
877
/* Check config setting for default timezone */
878
878
if (!DATEG (default_timezone )) {
879
879
/* Special case: ext/date wasn't initialized yet */
880
880
zval ztz ;
881
881
882
- 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 )) {
882
+ if (SUCCESS == zend_get_configuration_directive ("date.timezone" , sizeof ("date.timezone" ), & ztz )
883
+ && Z_TYPE (ztz ) == IS_STRING && Z_STRLEN (ztz ) > 0 && timelib_timezone_id_is_valid (Z_STRVAL (ztz ), tzdb )) {
883
884
return Z_STRVAL (ztz );
884
885
}
885
886
} else if (* DATEG (default_timezone )) {
886
- if (DATEG (timezone_valid ) == 1 ) { // timezone already checked and validated
887
+ if (DATEG (timezone_valid ) == 1 ) {
887
888
return DATEG (default_timezone );
888
889
}
889
890
0 commit comments