Make WordPress Core

Changeset 27611


Ignore:
Timestamp:
03/19/2014 05:46:02 AM (12 years ago)
Author:
nacin
Message:

Improve the autosave error message on nonce failure.

see #27453, #25272.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/post.php

    r27576 r27611  
    14351435        $post_data['ID'] = $post_data['post_ID'] = $post_id;
    14361436
    1437         if ( false === wp_verify_nonce( $post_data['_wpnonce'], 'update-post_' . $post_id ) )
    1438                 return new WP_Error( 'invalid_nonce', __('ERROR: invalid post data.') );
     1437        if ( false === wp_verify_nonce( $post_data['_wpnonce'], 'update-post_' . $post_id ) ) {
     1438                return new WP_Error( 'invalid_nonce', __( 'Error while saving.' ) );
     1439        }
    14391440
    14401441        $post = get_post( $post_id );
    14411442
    1442         if ( ! current_user_can( 'edit_post', $post->ID ) )
    1443                 return new WP_Error( 'edit_post', __('You are not allowed to edit this item.') );
     1443        if ( ! current_user_can( 'edit_post', $post->ID ) ) {
     1444                return new WP_Error( 'edit_posts', __( 'You are not allowed to edit this item.' ) );
     1445        }
    14441446
    14451447        if ( 'auto-draft' == $post->post_status )
Note: See TracChangeset for help on using the changeset viewer.