Skip to content

Commit 9934eff

Browse files
committed
Merge branch 'PHP-5.4' into PHP-5.5
2 parents 742b0e5 + d7da1aa commit 9934eff

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

ext/date/php_date.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -846,7 +846,7 @@ timelib_tzinfo *php_date_parse_tzfile_wrapper(char *formal_tzname, const timelib
846846
}
847847
/* }}} */
848848

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 */
850850
/* {{{ static PHP_INI_MH(OnUpdate_date_timezone) */
851851
static PHP_INI_MH(OnUpdate_date_timezone)
852852
{
@@ -871,19 +871,20 @@ static PHP_INI_MH(OnUpdate_date_timezone)
871871
static char* guess_timezone(const timelib_tzdb *tzdb TSRMLS_DC)
872872
{
873873
/* Checking configure timezone */
874-
if (DATEG(timezone) && strlen(DATEG(timezone)) > 0) {
874+
if (DATEG(timezone) && (strlen(DATEG(timezone))) > 0) {
875875
return DATEG(timezone);
876876
}
877877
/* Check config setting for default timezone */
878878
if (!DATEG(default_timezone)) {
879879
/* Special case: ext/date wasn't initialized yet */
880880
zval ztz;
881881

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)) {
883884
return Z_STRVAL(ztz);
884885
}
885886
} else if (*DATEG(default_timezone)) {
886-
if (DATEG(timezone_valid) == 1) { // timezone already checked and validated
887+
if (DATEG(timezone_valid) == 1) {
887888
return DATEG(default_timezone);
888889
}
889890

0 commit comments

Comments
 (0)