WordPress.org

Make WordPress Core

Ticket #8701: 8701.correct.diff

File 8701.correct.diff, 973 bytes (added by jacobsantos, 7 years ago)

Fix error reporting for PHP 6 and PHP 5.3

  • wp-settings.php

     
    201201if (defined('WP_DEBUG') and WP_DEBUG == true) { 
    202202        error_reporting(E_ALL); 
    203203} else { 
    204         if ( defined( 'E_DEPRECATED' ) ) // Introduced in PHP 5.3 
    205                 error_reporting( (E_ALL ^ E_DEPRECATED ^ E_NOTICE ^ E_USER_NOTICE) & E_STRICT); 
    206         else if ( defined( 'E_STRICT' ) ) // Introduced in PHP 5.0 not part of E_ALL 
    207                 error_reporting( ( E_ALL ^ E_NOTICE ^ E_USER_NOTICE ) & E_STRICT); 
     204        // Unicode Extension is in PHP 6.0 only or do version check when this changes. 
     205        if ( function_exists('unicode_decode') ) 
     206                error_reporting( E_ALL ^ E_DEPRECATED ^ E_NOTICE ^ E_USER_NOTICE ^ E_STRICT ); 
     207        else if ( defined( 'E_DEPRECATED' ) ) // Introduced in PHP 5.3 
     208                error_reporting( E_ALL ^ E_DEPRECATED ^ E_NOTICE ^ E_USER_NOTICE ); 
    208209        else 
    209210                error_reporting(E_ALL ^ E_NOTICE ^ E_USER_NOTICE); 
    210211}