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