WordPress.org

Make WordPress Core

Ticket #7246: 7246.diff

File 7246.diff, 1.5 KB (added by DD32, 10 years ago)
  • wp-includes/comment.php

     
    452452                        if ( defined('DOING_AJAX') )
    453453                                die( __('You are posting comments too quickly.  Slow down.') );
    454454
    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) );
    456456                }
    457457        }
    458458}
  • wp-includes/functions.php

     
    22062208 *
    22072209 * @param string $message Error message.
    22082210 * @param string $title Error title.
     2211 * @param string|array $args Optional arguements to control behaviour.
    22092212 */
    2210 function wp_die( $message, $title = '' ) {
     2213function wp_die( $message, $title = '', $args = array() ) {
    22112214        global $wp_locale;
    22122215
     2216        $defaults = array( 'response' => 500 );
     2217        $r = wp_parse_args($args, $defaults);
     2218
    22132219        if ( function_exists( 'is_wp_error' ) && is_wp_error( $message ) ) {
    22142220                if ( empty( $title ) ) {
    22152221                        $error_data = $message->get_error_data();
     
    22432249
    22442250        if ( !function_exists( 'did_action' ) || !did_action( 'admin_head' ) ) :
    22452251        if( !headers_sent() ){
    2246                 status_header( 500 );
     2252                status_header( $r['response'] );
    22472253                nocache_headers();
    22482254                header( 'Content-Type: text/html; charset=utf-8' );
    22492255        }