Ticket #23017: 23017-set-error-handler.diff

File 23017-set-error-handler.diff, 968 bytes (added by beaucollins, 4 months ago)
  • wp-includes/class-wp-xmlrpc-server.php

     
    3333         * @return wp_xmlrpc_server 
    3434         */ 
    3535        function __construct() { 
     36                if ( ! WP_DEBUG ) { 
     37                        set_error_handler( array( $this, 'handle_nonfatal_errors' ), E_WARNING | E_NOTICE | E_USER_WARNING | E_USER_NOTICE | E_STRICT | E_RECOVERABLE_ERROR | E_DEPRECATED | E_USER_DEPRECATED ); 
     38                } 
    3639                $this->methods = array( 
    3740                        // WordPress API 
    3841                        'wp.getUsersBlogs'              => 'this:wp_getUsersBlogs', 
     
    54965499 
    54975500                return $pingbacks; 
    54985501        } 
     5502        // handler ( int $errno , string $errstr [, string $errfile [, int $errline [, array $errcontext ]]] ) 
     5503        function handle_nonfatal_errors( $errno, $errstr, $errfile = nil, $errline = nil, $errcontext = nil ){ 
     5504                // Swallow non-fatal errors to prevent invalid XML 
     5505                return true; 
     5506        } 
    54995507}