summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Strojny <lstrojny@php.net>2013-01-06 14:08:23 +0100
committerLars Strojny <lstrojny@php.net>2013-01-06 14:08:23 +0100
commitd7da1aa694a9a29ca7ec772e5d51d96b6dc8dda0 (patch)
tree8f3bddebdb5a5a562f715557701f6b6c6297c8a9
parenta426e0b05074621643c44b67ed2d0d8674721bf5 (diff)
downloadphp-git-d7da1aa694a9a29ca7ec772e5d51d96b6dc8dda0.tar.gz
Coding style, ANSI C compatibility
-rw-r--r--ext/date/php_date.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/ext/date/php_date.c b/ext/date/php_date.c
index 1837f94520..765b0bfe7b 100644
--- a/ext/date/php_date.c
+++ b/ext/date/php_date.c
@@ -847,7 +847,7 @@ timelib_tzinfo *php_date_parse_tzfile_wrapper(char *formal_tzname, const timelib
}
/* }}} */
-// created this callback method to check the date.timezone only when changed, to increase performance and error on an ini_set line
+/* Callback to check the date.timezone only when changed increases performance */
/* {{{ static PHP_INI_MH(OnUpdate_date_timezone) */
static PHP_INI_MH(OnUpdate_date_timezone)
{
@@ -872,7 +872,7 @@ static PHP_INI_MH(OnUpdate_date_timezone)
static char* guess_timezone(const timelib_tzdb *tzdb TSRMLS_DC)
{
/* Checking configure timezone */
- if (DATEG(timezone) && strlen(DATEG(timezone)) > 0) {
+ if (DATEG(timezone) && (strlen(DATEG(timezone))) > 0) {
return DATEG(timezone);
}
/* Check config setting for default timezone */
@@ -880,11 +880,12 @@ static char* guess_timezone(const timelib_tzdb *tzdb TSRMLS_DC)
/* Special case: ext/date wasn't initialized yet */
zval ztz;
- 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)) {
+ 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)) {
return Z_STRVAL(ztz);
}
} else if (*DATEG(default_timezone)) {
- if (DATEG(timezone_valid) == 1) { // timezone already checked and validated
+ if (DATEG(timezone_valid) == 1) {
return DATEG(default_timezone);
}