Ticket #7246: 7246.diff
| File 7246.diff, 1.5 KB (added by DD32, 5 years ago) |
|---|
-
wp-includes/comment.php
452 452 if ( defined('DOING_AJAX') ) 453 453 die( __('You are posting comments too quickly. Slow down.') ); 454 454 455 wp_die( __('You are posting comments too quickly. Slow down.') );455 wp_die( __('You are posting comments too quickly. Slow down.'), '', array('response' => 403) ); 456 456 } 457 457 } 458 458 } -
wp-includes/functions.php
2206 2208 * 2207 2209 * @param string $message Error message. 2208 2210 * @param string $title Error title. 2211 * @param string|array $args Optional arguements to control behaviour. 2209 2212 */ 2210 function wp_die( $message, $title = '' ) {2213 function wp_die( $message, $title = '', $args = array() ) { 2211 2214 global $wp_locale; 2212 2215 2216 $defaults = array( 'response' => 500 ); 2217 $r = wp_parse_args($args, $defaults); 2218 2213 2219 if ( function_exists( 'is_wp_error' ) && is_wp_error( $message ) ) { 2214 2220 if ( empty( $title ) ) { 2215 2221 $error_data = $message->get_error_data(); … … 2243 2249 2244 2250 if ( !function_exists( 'did_action' ) || !did_action( 'admin_head' ) ) : 2245 2251 if( !headers_sent() ){ 2246 status_header( 500);2252 status_header( $r['response'] ); 2247 2253 nocache_headers(); 2248 2254 header( 'Content-Type: text/html; charset=utf-8' ); 2249 2255 }
