Don't error_log() if error_log file is not writable. see #5771
git-svn-id: https://develop.svn.wordpress.org/trunk@7418 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
82ee87ed23
commit
561b190a79
|
@ -189,8 +189,17 @@ class wpdb {
|
||||||
$error_str = "WordPress database error $str for query $this->last_query";
|
$error_str = "WordPress database error $str for query $this->last_query";
|
||||||
if ( $caller = $this->get_caller() )
|
if ( $caller = $this->get_caller() )
|
||||||
$error_str .= " made by $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..
|
// Is error output turned on or not..
|
||||||
if ( !$this->show_errors )
|
if ( !$this->show_errors )
|
||||||
|
|
Loading…
Reference in New Issue