WordPress.org

Make WordPress Core

Changeset 7418


Ignore:
Timestamp:
03/20/08 19:08:40 (6 years ago)
Author:
ryan
Message:

Don't error_log() if error_log file is not writable. see #5771

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/wp-db.php

    r7269 r7418  
    190190        if ( $caller = $this->get_caller() ) 
    191191            $error_str .= " made by $caller"; 
    192          
    193         @error_log($error_str, 0); 
     192 
     193        $log_error = true; 
     194        if ( ! function_exists('error_log') ) 
     195            $log_error = false; 
     196 
     197        $log_file = @ini_get('error_log'); 
     198        if ( !empty($log_file) && ('syslog' != $log_file) && !is_readable($log_file) ) 
     199            $log_error = false; 
     200 
     201        if ( $log_error ) 
     202            @error_log($error_str, 0); 
    194203 
    195204        // Is error output turned on or not.. 
Note: See TracChangeset for help on using the changeset viewer.