Make WordPress Core

Changeset 23889


Ignore:
Timestamp:
04/03/2013 04:34:14 AM (12 years ago)
Author:
nacin
Message:

No need to check for the presence of a current user in a privileged ajax action. see #23665.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/ajax-actions.php

    r23872 r23889  
    10431043        unset($_POST['post_category']);
    10441044
    1045     $do_autosave = (bool) $_POST['autosave'];
    10461045    $data = '';
    10471046    $supplemental = array();
    10481047    $id = $revision_id = 0;
    1049 
    1050     if ( ! $user_id = get_current_user_id() )
    1051         wp_die('-1');
    10521048
    10531049    $post_id = (int) $_POST['post_id'];
     
    10651061    }
    10661062
    1067     if ( $do_autosave ) {
     1063    if ( ! empty( $_POST['autosave'] ) ) {
    10681064        // Drafts and auto-drafts are just overwritten by autosave for the same user
    10691065        if ( $user_id == $post->post_author && ( 'auto-draft' == $post->post_status || 'draft' == $post->post_status ) ) {
Note: See TracChangeset for help on using the changeset viewer.