Don't error_log() if error_log file is not writable. see #5771
git-svn-id: http://svn.automattic.com/wordpress/trunk@7418 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
8955cc0fba
commit
c5d75f1195
|
@ -189,8 +189,17 @@ class wpdb {
|
|||
$error_str = "WordPress database error $str for query $this->last_query";
|
||||
if ( $caller = $this->get_caller() )
|
||||
$error_str .= " made by $caller";
|
||||
|
||||
@error_log($error_str, 0);
|
||||
|
||||
$log_error = true;
|
||||
if ( ! function_exists('error_log') )
|
||||
$log_error = false;
|
||||
|
||||
$log_file = @ini_get('error_log');
|
||||
if ( !empty($log_file) && ('syslog' != $log_file) && !is_readable($log_file) )
|
||||
$log_error = false;
|
||||
|
||||
if ( $log_error )
|
||||
@error_log($error_str, 0);
|
||||
|
||||
// Is error output turned on or not..
|
||||
if ( !$this->show_errors )
|
||||
|
|
Loading…
Reference in New Issue