WordPress.org

Make WordPress Core

Ticket #23017: 23017.diff

File 23017.diff, 920 bytes (added by koke, 2 years ago)
  • xmlrpc.php

     
    2828/** Include the bootstrap for setting up WordPress environment */ 
    2929include('./wp-load.php'); 
    3030 
     31add_action( 'shutdown', 'xmlrpc_shutdown' ); 
     32 
    3133if ( isset( $_GET['rsd'] ) ) { // http://archipelago.phrasewise.com/rsd 
    3234header('Content-Type: text/xml; charset=' . get_option('blog_charset'), true); 
    3335?> 
     
    8385        _deprecated_function( __FUNCTION__, '3.4', 'error_log()' ); 
    8486        if ( ! empty( $GLOBALS['xmlrpc_logging'] ) ) 
    8587                error_log( $io . ' - ' . $msg ); 
    86 } 
    87  No newline at end of file 
     88} 
     89 
     90function xmlrpc_shutdown() { 
     91        $error = error_get_last(); 
     92        if ( $error !== NULL && E_ERROR == $error['type'] ) { 
     93                ob_clean(); 
     94                $message = sprintf( '"%s" in %s:%d', $error['message'], $error['file'], $error['line'] ); 
     95                wp_die( $message ); 
     96        } 
     97}