From 151520ee028e66894afe62a6bbef8b040d964b88 Mon Sep 17 00:00:00 2001 From: Boone Gorges Date: Thu, 26 Mar 2015 01:44:03 +0000 Subject: [PATCH] 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. git-svn-id: https://develop.svn.wordpress.org/trunk@31896 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/includes/post.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wp-admin/includes/post.php b/src/wp-admin/includes/post.php index 4dc46ac3df..cf8c8e9f01 100644 --- a/src/wp-admin/includes/post.php +++ b/src/wp-admin/includes/post.php @@ -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 );