Make WordPress Core

Ticket #37569: 37569.patch

File 37569.patch, 830 bytes (added by iseulde, 8 years ago)
  • src/wp-includes/rest-api.php

     
    587587                return true;
    588588        }
    589589
     590        // Send a refreshed nonce in header.
     591        $wp_rest_server->send_header( 'X-WP-Nonce', wp_create_nonce( 'wp_rest' ) );
     592
    590593        // Check the nonce.
    591594        $result = wp_verify_nonce( $nonce, 'wp_rest' );
    592595
    593596        if ( ! $result ) {
    594                 return new WP_Error( 'rest_cookie_invalid_nonce', __( 'Cookie nonce is invalid' ), array( 'status' => 403 ) );
     597                return new WP_Error( 'rest_cookie_expired_nonce', __( 'Cookie nonce expired' ), array( 'status' => 403 ) );
    595598        }
    596599
    597         // Send a refreshed nonce in header.
    598         $wp_rest_server->send_header( 'X-WP-Nonce', wp_create_nonce( 'wp_rest' ) );
    599 
    600600        return true;
    601601}
    602602