Changeset 19801
- Timestamp:
- 01/31/2012 10:12:58 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/class-wp-ajax-response.php
r19712 r19801 132 132 echo $response; 133 133 echo '</wp_ajax>'; 134 die();134 wp_die(); 135 135 } 136 136 } -
trunk/wp-includes/functions.php
r19777 r19801 2044 2044 * @param string|array $args Optional arguments to control behavior. 2045 2045 */ 2046 function wp_die( $message , $title = '', $args = array() ) {2046 function wp_die( $message = '', $title = '', $args = array() ) { 2047 2047 if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) 2048 die('-1'); 2049 2050 if ( function_exists( 'apply_filters' ) ) { 2051 $function = apply_filters( 'wp_die_handler', '_default_wp_die_handler'); 2052 } else { 2053 $function = '_default_wp_die_handler'; 2054 } 2048 $function = apply_filters( 'wp_die_ajax_handler', '_ajax_wp_die_handler' ); 2049 elseif ( defined( 'XMLRPC_REQUEST' ) && XMLRPC_REQUEST ) 2050 $function = apply_filters( 'wp_die_xmlrpc_handler', '_xmlrpc_wp_die_handler' ); 2051 else 2052 $function = apply_filters( 'wp_die_handler', '_default_wp_die_handler' ); 2055 2053 2056 2054 call_user_func( $function, $message, $title, $args ); … … 2103 2101 } 2104 2102 2105 if ( ! function_exists( 'did_action' ) || !did_action( 'admin_head' ) ) :2103 if ( ! did_action( 'admin_head' ) ) : 2106 2104 if ( !headers_sent() ) { 2107 2105 status_header( $r['response'] ); … … 2207 2205 </head> 2208 2206 <body id="error-page"> 2209 <?php endif; // ! function_exists( 'did_action' ) || !did_action( 'admin_head' ) ?>2207 <?php endif; // ! did_action( 'admin_head' ) ?> 2210 2208 <?php echo $message; ?> 2211 2209 </body> … … 2241 2239 2242 2240 /** 2243 * Filter to enable special wp_die handler for xmlrpc requests. 2244 * 2245 * @since 3.2.0 2241 * Kill WordPress ajax execution. 2242 * 2243 * This is the handler for wp_die when processing Ajax requests. 2244 * 2245 * @since 3.4.0 2246 2246 * @access private 2247 */ 2248 function _xmlrpc_wp_die_filter() { 2249 return '_xmlrpc_wp_die_handler'; 2247 * 2248 * @param string $message Optional. Response to print. 2249 */ 2250 function _ajax_wp_die_handler( $message = '' ) { 2251 if ( is_scalar( $message ) ) 2252 die( (string) $message ); 2253 die( '0' ); 2250 2254 } 2251 2255 -
trunk/wp-includes/pluggable.php
r19771 r19801 830 830 $result = wp_verify_nonce( $nonce, $action ); 831 831 832 if ( $die && false == $result ) 833 die('-1'); 832 if ( $die && false == $result ) { 833 if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) 834 wp_die( -1 ); 835 else 836 die( '-1' ); 837 } 834 838 835 839 do_action('check_ajax_referer', $action, $result); -
trunk/xmlrpc.php
r19712 r19801 99 99 logIO("I", $HTTP_RAW_POST_DATA); 100 100 101 // Make sure wp_die output is XML102 add_filter( 'wp_die_handler', '_xmlrpc_wp_die_filter' );103 104 101 // Allow for a plugin to insert a different class to handle requests. 105 102 $wp_xmlrpc_server_class = apply_filters('wp_xmlrpc_server_class', 'wp_xmlrpc_server');
Note: See TracChangeset
for help on using the changeset viewer.