diff options
author | Xinchen Hui <laruence@php.net> | 2012-09-23 22:59:31 +0800 |
---|---|---|
committer | Xinchen Hui <laruence@php.net> | 2012-09-23 22:59:31 +0800 |
commit | 395d77c540a2d9d0745c8b4c75d60599c6e17c87 (patch) | |
tree | 82ed15afe43e085b09625d52227a4e0534d44497 | |
parent | c8687ee63b0aa0cbe8da1e8d5c65a338eb69f83a (diff) | |
download | php-git-395d77c540a2d9d0745c8b4c75d60599c6e17c87.tar.gz |
Fixed bug #60723 (error_log error time has changed to UTC ignoring default timezo)
-rw-r--r-- | NEWS | 2 | ||||
-rw-r--r-- | ext/standard/tests/general_functions/bug60723.phpt | 17 | ||||
-rw-r--r-- | main/main.c | 10 |
3 files changed, 28 insertions, 1 deletions
@@ -24,6 +24,8 @@ PHP NEWS situation). (Dmitry) . Fixed bug #60909 (custom error handler throwing Exception + fatal error = no shutdown function). (Dmitry) + . Fixed bug #60723 (error_log error time has changed to UTC ignoring default + timezo). (Laruence) - DOM: . Fixed bug #63015 (Incorrect arginfo for DOMErrorHandler). (Rob) diff --git a/ext/standard/tests/general_functions/bug60723.phpt b/ext/standard/tests/general_functions/bug60723.phpt new file mode 100644 index 0000000000..1d9ef6a1d4 --- /dev/null +++ b/ext/standard/tests/general_functions/bug60723.phpt @@ -0,0 +1,17 @@ +--TEST-- +Bug #55371 (get_magic_quotes_gpc() and get_magic_quotes_runtime() throw deprecated warning) +--INI-- +date.timezone=ASIA/Chongqing +log_errors=On +--FILE-- +<?php +$dir = dirname(__FILE__); +$log = $dir . "/tmp.err"; +ini_set("error_log", $log); +echo $aa; +readfile($log); +unlink($log); +?> +--EXPECTF-- +Notice: Undefined variable: aa in %sbug60723.php on line %d +[%s ASIA/Chongqing] PHP Notice: Undefined variable: aa in %sbug60723.php on line %d diff --git a/main/main.c b/main/main.c index 8d97581d60..44c61c6005 100644 --- a/main/main.c +++ b/main/main.c @@ -628,7 +628,15 @@ PHPAPI void php_log_err(char *log_message TSRMLS_DC) char *error_time_str; time(&error_time); - error_time_str = php_format_date("d-M-Y H:i:s e", 13, error_time, 0 TSRMLS_CC); +#ifdef ZTS + if (!php_during_module_startup()) { + error_time_str = php_format_date("d-M-Y H:i:s e", 13, error_time, 1 TSRMLS_CC); + } else { + error_time_str = php_format_date("d-M-Y H:i:s e", 13, error_time, 0 TSRMLS_CC); + } +#else + error_time_str = php_format_date("d-M-Y H:i:s e", 13, error_time, 1 TSRMLS_CC); +#endif len = spprintf(&tmp, 0, "[%s] %s%s", error_time_str, log_message, PHP_EOL); #ifdef PHP_WIN32 php_flock(fd, 2); |