Check that $_POST array index is set before comparing it in post_preview().

This prevents PHP notices in cases where a user with 'edit_others_posts' but
without 'publish_posts' previews another user's posts.

Props tyxla.
Fixes #31760.
Built from https://develop.svn.wordpress.org/trunk@31896


git-svn-id: http://core.svn.wordpress.org/trunk@31875 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Boone Gorges 2015-03-26 01:45:26 +00:00
parent bc3d8197aa
commit 60c26865f9
2 changed files with 2 additions and 2 deletions

View File

@ -1667,7 +1667,7 @@ function post_preview() {
} else {
$is_autosave = true;
if ( 'auto-draft' == $_POST['post_status'] )
if ( isset( $_POST['post_status'] ) && 'auto-draft' == $_POST['post_status'] )
$_POST['post_status'] = 'draft';
$saved_post_id = wp_create_post_autosave( $post->ID );

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.2-beta2-31895';
$wp_version = '4.2-beta2-31896';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.