Ticket #20042: 20042.diff
| File 20042.diff, 2.9 KB (added by nacin, 15 months ago) |
|---|
-
wp-app.php
26 26 27 27 $_SERVER['PATH_INFO'] = preg_replace( '/.*\/wp-app\.php/', '', $_SERVER['REQUEST_URI'] ); 28 28 29 // Allow for a plugin to insert a different class to handle requests. 30 $wp_atom_server_class = apply_filters('wp_atom_server_class', 'wp_atom_server'); 31 $wp_atom_server = new $wp_atom_server_class; 32 33 // Handle the request 34 $wp_atom_server->handle_request(); 35 36 exit; 37 29 38 /** 30 39 * Writes logging info to a file. 31 40 * … … 42 51 if ( ! empty( $GLOBALS['app_logging'] ) ) 43 52 error_log( $label . ' - ' . $message ); 44 53 } 45 46 // Allow for a plugin to insert a different class to handle requests.47 $wp_atom_server_class = apply_filters('wp_atom_server_class', 'wp_atom_server');48 $wp_atom_server = new $wp_atom_server_class;49 50 // Handle the request51 $wp_atom_server->handle_request(); -
wp-includes/class-wp-atom-server.php
175 175 'PUT' => 'put_attachment', 176 176 'DELETE' => 'delete_attachment'), 177 177 ); 178 179 add_filter( 'wp_die_handler', array( $this, 'return_atom_die_handler' ) );180 178 } 181 179 182 180 /** 183 * Override die handler184 * @return callback185 */186 public function return_atom_die_handler() {187 return array( $this, 'atom_die_handler' );188 }189 190 /**191 * Die with a message. Only accept strings, no WP_Error objects yet192 * @param string $message193 * @return void194 */195 public function atom_die_handler( $message ) {196 if ( is_scalar( $message ) )197 die( (string) $message );198 die();199 }200 201 /**202 181 * Handle ATOMPUB request. 203 182 * 204 183 * @since 2.2.0 -
wp-includes/functions.php
1976 1976 $function = apply_filters( 'wp_die_ajax_handler', '_ajax_wp_die_handler' ); 1977 1977 elseif ( defined( 'XMLRPC_REQUEST' ) && XMLRPC_REQUEST ) 1978 1978 $function = apply_filters( 'wp_die_xmlrpc_handler', '_xmlrpc_wp_die_handler' ); 1979 elseif ( defined( 'APP_REQUEST' ) && APP_REQUEST ) 1980 $function = apply_filters( 'wp_die_app_bandler', '_scalar_wp_die_handler' ); 1979 1981 else 1980 1982 $function = apply_filters( 'wp_die_handler', '_default_wp_die_handler' ); 1981 1983 … … 2182 2184 } 2183 2185 2184 2186 /** 2187 * Kill WordPress execution. 2188 * 2189 * This is the handler for wp_die when processing APP requests. 2190 * 2191 * @since 3.4.0 2192 * @access private 2193 * 2194 * @param string $message Optional. Response to print. 2195 */ 2196 function _scalar_wp_die_handler( $message = '' ) { 2197 if ( is_scalar( $message ) ) 2198 die( (string) $message ); 2199 die(); 2200 } 2201 2202 /** 2185 2203 * Retrieve the WordPress home page URL. 2186 2204 * 2187 2205 * If the constant named 'WP_HOME' exists, then it will be used and returned by
