Make WordPress Core

Ticket #11090: wp_debug_identical.patch

File wp_debug_identical.patch, 4.9 KB (added by nacin, 17 years ago)

true === WP_DEBUG

  • wp-includes/http.php

     
    655655
    656656                $proxy = new WP_HTTP_Proxy();
    657657
    658                 if ( !defined('WP_DEBUG') || ( defined('WP_DEBUG') && false === WP_DEBUG ) ) {
     658                if ( defined('WP_DEBUG') && true === WP_DEBUG ) ) {
    659659                        if ( $proxy->is_enabled() && $proxy->send_through_proxy( $url ) )
    660                                 $handle = @fsockopen( $proxy->host(), $proxy->port(), $iError, $strError, $r['timeout'] );
     660                                $handle = fsockopen( $proxy->host(), $proxy->port(), $iError, $strError, $r['timeout'] );
    661661                        else
    662                                 $handle = @fsockopen( $fsockopen_host, $arrURL['port'], $iError, $strError, $r['timeout'] );
     662                                $handle = fsockopen( $fsockopen_host, $arrURL['port'], $iError, $strError, $r['timeout'] );
    663663                } else {
    664664                        if ( $proxy->is_enabled() && $proxy->send_through_proxy( $url ) )
    665                                 $handle = fsockopen( $proxy->host(), $proxy->port(), $iError, $strError, $r['timeout'] );
     665                                $handle = @fsockopen( $proxy->host(), $proxy->port(), $iError, $strError, $r['timeout'] );
    666666                        else
    667                                 $handle = fsockopen( $fsockopen_host, $arrURL['port'], $iError, $strError, $r['timeout'] );
     667                                $handle = @fsockopen( $fsockopen_host, $arrURL['port'], $iError, $strError, $r['timeout'] );
    668668                }
    669669
    670670                $endDelay = time();
     
    826826                if ( 'http' != $arrURL['scheme'] && 'https' != $arrURL['scheme'] )
    827827                        $url = str_replace($arrURL['scheme'], 'http', $url);
    828828
    829                 if ( !defined('WP_DEBUG') || ( defined('WP_DEBUG') && false === WP_DEBUG ) )
     829                if ( defined('WP_DEBUG') && true === WP_DEBUG ) )
     830                        $handle = fopen($url, 'r');
     831                else
    830832                        $handle = @fopen($url, 'r');
    831                 else
    832                         $handle = fopen($url, 'r');
    833833
    834834                if (! $handle)
    835835                        return new WP_Error('http_request_failed', sprintf(__('Could not open handle for fopen() to %s'), $url));
     
    999999
    10001000                $context = stream_context_create($arrContext);
    10011001
    1002                 if ( ! defined('WP_DEBUG') || ( defined('WP_DEBUG') && false === WP_DEBUG ) )
     1002                if ( defined('WP_DEBUG') && true === WP_DEBUG ) )
     1003                        $handle = fopen($url, 'r', false, $context);
     1004                else
    10031005                        $handle = @fopen($url, 'r', false, $context);
    1004                 else
    1005                         $handle = fopen($url, 'r', false, $context);
    10061006
    10071007                if ( ! $handle)
    10081008                        return new WP_Error('http_request_failed', sprintf(__('Could not open handle for fopen() to %s'), $url));
     
    11671167                        }
    11681168                }
    11691169
    1170                 if ( !defined('WP_DEBUG') || ( defined('WP_DEBUG') && false === WP_DEBUG ) ) //Emits warning level notices for max redirects and timeouts
     1170                if ( defined('WP_DEBUG') && true === WP_DEBUG ) ) //Emits warning level notices for max redirects and timeouts
     1171                        $strResponse = http_request($r['method'], $url, $r['body'], $options, $info); //Emits warning level notices for max redirects and timeouts
     1172                else
    11711173                        $strResponse = @http_request($r['method'], $url, $r['body'], $options, $info);
    1172                 else
    1173                         $strResponse = http_request($r['method'], $url, $r['body'], $options, $info); //Emits warning level notices for max redirects and timeouts
    11741174
    11751175                // Error may still be set, Response may return headers or partial document, and error
    11761176                // contains a reason the request was aborted, eg, timeout expired or max-redirects reached.
     
    11841184                $theHeaders = WP_Http::processHeaders($theHeaders);
    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 ( defined('WP_DEBUG') && true === WP_DEBUG ) )
     1188                                $theBody = http_chunked_decode($theBody);
     1189                        else
    11881190                                $theBody = @http_chunked_decode($theBody);
    1189                         else
    1190                                 $theBody = http_chunked_decode($theBody);
    11911191                }
    11921192
    11931193                if ( true === $r['decompress'] && true === WP_Http_Encoding::should_decode($theHeaders['headers']) )
  • wp-includes/wp-db.php

     
    357357        function __construct($dbuser, $dbpassword, $dbname, $dbhost) {
    358358                register_shutdown_function(array(&$this, "__destruct"));
    359359
    360                 if ( defined('WP_DEBUG') and WP_DEBUG == true )
     360                if ( defined('WP_DEBUG') and true === WP_DEBUG )
    361361                        $this->show_errors();
    362362
    363363                if ( defined('DB_CHARSET') )
  • wp-settings.php

     
    199199timer_start();
    200200
    201201// Add define('WP_DEBUG',true); to wp-config.php to enable display of notices during development.
    202 if ( defined('WP_DEBUG') && WP_DEBUG == true ) {
     202if ( defined('WP_DEBUG') && true === WP_DEBUG ) {
    203203        error_reporting(E_ALL);
    204204        // Add define('WP_DEBUG_DISPLAY', false); to wp-config.php to use the globally configured setting for display_errors and not force it to On
    205205        if ( ! defined('WP_DEBUG_DISPLAY') || WP_DEBUG_DISPLAY == true )