Make WordPress Core

Changeset 12207


Ignore:
Timestamp:
11/18/2009 08:22:49 AM (17 years ago)
Author:
westi
Message:

Ensure WP_DEBUG is always defined and simplify the checks on it. Fixes #11090 props nacin.

Location:
trunk
Files:
4 edited

Legend:

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

    r12203 r12207  
    29282928 * function.
    29292929 *
    2930  * The current behavior is to trigger an user error if WP_DEBUG is defined and
    2931  * is true.
     2930 * The current behavior is to trigger an user error if WP_DEBUG is true.
    29322931 *
    29332932 * This function is to be used in every function in depreceated.php
    … …  
    29502949
    29512950        // Allow plugin to filter the output error trigger
    2952         if( defined('WP_DEBUG') && ( true === WP_DEBUG ) && apply_filters( 'deprecated_function_trigger_error', true )) {
     2951        if( WP_DEBUG && apply_filters( 'deprecated_function_trigger_error', true )) {
    29532952                if( !is_null($replacement) )
    29542953                        trigger_error( sprintf( __('%1$s is <strong>deprecated</strong> since version %2$s! Use %3$s instead.'), $function, $version, $replacement ) );
    … …  
    29652964 * file.
    29662965 *
    2967  * The current behavior is to trigger an user error if WP_DEBUG is defined and
    2968  * is true.
     2966 * The current behavior is to trigger an user error if WP_DEBUG is true.
    29692967 *
    29702968 * This function is to be used in every file that is depreceated
    … …  
    29872985
    29882986        // Allow plugin to filter the output error trigger
    2989         if( defined('WP_DEBUG') && ( true === WP_DEBUG ) && apply_filters( 'deprecated_file_trigger_error', true )) {
     2987        if( WP_DEBUG && apply_filters( 'deprecated_file_trigger_error', true ) ) {
    29902988                if( !is_null($replacement) )
    29912989                        trigger_error( sprintf( __('%1$s is <strong>deprecated</strong> since version %2$s! Use %3$s instead.'), $file, $version, $replacement ) );
  • trunk/wp-includes/http.php

    r11977 r12207  
    656656                $proxy = new WP_HTTP_Proxy();
    657657
    658                 if ( !defined('WP_DEBUG') || ( defined('WP_DEBUG') && false === WP_DEBUG ) ) {
     658                if ( !WP_DEBUG ) {
    659659                        if ( $proxy->is_enabled() && $proxy->send_through_proxy( $url ) )
    660660                                $handle = @fsockopen( $proxy->host(), $proxy->port(), $iError, $strError, $r['timeout'] );
    … …  
    827827                        $url = str_replace($arrURL['scheme'], 'http', $url);
    828828
    829                 if ( !defined('WP_DEBUG') || ( defined('WP_DEBUG') && false === WP_DEBUG ) )
     829                if ( !WP_DEBUG )
    830830                        $handle = @fopen($url, 'r');
    831831                else
    … …  
    10001000                $context = stream_context_create($arrContext);
    10011001
    1002                 if ( ! defined('WP_DEBUG') || ( defined('WP_DEBUG') && false === WP_DEBUG ) )
     1002                if ( !WP_DEBUG )
    10031003                        $handle = @fopen($url, 'r', false, $context);
    10041004                else
    … …  
    11681168                }
    11691169
    1170                 if ( !defined('WP_DEBUG') || ( defined('WP_DEBUG') && false === WP_DEBUG ) ) //Emits warning level notices for max redirects and timeouts
     1170                if ( !WP_DEBUG ) //Emits warning level notices for max redirects and timeouts
    11711171                        $strResponse = @http_request($r['method'], $url, $r['body'], $options, $info);
    11721172                else
    … …  
    11851185
    11861186                if ( ! empty( $theBody ) && isset( $theHeaders['headers']['transfer-encoding'] ) && 'chunked' == $theHeaders['headers']['transfer-encoding'] ) {
    1187                         if ( !defined('WP_DEBUG') || ( defined('WP_DEBUG') && false === WP_DEBUG ) )
     1187                        if ( !WP_DEBUG )
    11881188                                $theBody = @http_chunked_decode($theBody);
    11891189                        else
  • trunk/wp-includes/wp-db.php

    r11943 r12207  
    358358                register_shutdown_function(array(&$this, "__destruct"));
    359359
    360                 if ( defined('WP_DEBUG') and WP_DEBUG == true )
     360                if ( WP_DEBUG )
    361361                        $this->show_errors();
    362362
  • trunk/wp-settings.php

    r12192 r12207  
    211211        }
    212212} else {
     213        define('WP_DEBUG', false);
    213214        if ( defined('E_RECOVERABLE_ERROR') )
    214215                error_reporting(E_ERROR | E_WARNING | E_PARSE | E_USER_ERROR | E_USER_WARNING | E_RECOVERABLE_ERROR);
Note: See TracChangeset for help on using the changeset viewer.