WordPress.org

Make WordPress Core

Ticket #16748: 16748.diff

File 16748.diff, 892 bytes (added by koke, 7 years ago)
  • xmlrpc.php

     
    9898if ( isset($HTTP_RAW_POST_DATA) )
    9999        logIO("I", $HTTP_RAW_POST_DATA);
    100100
     101function xmlrpc_wp_die($message, $title = '', $args = array()) {
     102        global $wp_xmlrpc_server;
     103
     104        if ($wp_xmlrpc_server) {
     105                $error = new IXR_Error(500, $message);
     106                $wp_xmlrpc_server->output($error->getXml());
     107        }
     108}
     109
     110function xmlrpc_wp_die_filter() {
     111        return "xmlrpc_wp_die";
     112}
     113add_filter('wp_die_handler', 'xmlrpc_wp_die_filter');
     114
    101115// Allow for a plugin to insert a different class to handle requests.
    102116$wp_xmlrpc_server_class = apply_filters('wp_xmlrpc_server_class', 'wp_xmlrpc_server');
    103117$wp_xmlrpc_server = new $wp_xmlrpc_server_class;
    104118
    105119// Fire off the request
    106120$wp_xmlrpc_server->serve_request();
    107 ?>
    108  No newline at end of file
     121?>