Make WordPress Core

Ticket #31760: 31760.patch

File 31760.patch, 499 bytes (added by tyxla, 10 years ago)

When user has no publish_posts capability, check for post_status before using it.

  • src/wp-admin/includes/post.php

     
    16671667        } else {
    16681668                $is_autosave = true;
    16691669
    1670                 if ( 'auto-draft' == $_POST['post_status'] )
     1670                if ( isset( $_POST['post_status'] ) && 'auto-draft' == $_POST['post_status'] )
    16711671                        $_POST['post_status'] = 'draft';
    16721672
    16731673                $saved_post_id = wp_create_post_autosave( $post->ID );