From 60c26865f94e302f18548564324f78f2b2bbad5f Mon Sep 17 00:00:00 2001 From: Boone Gorges Date: Thu, 26 Mar 2015 01:45:26 +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. Built from https://develop.svn.wordpress.org/trunk@31896 git-svn-id: http://core.svn.wordpress.org/trunk@31875 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/post.php | 2 +- wp-includes/version.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/wp-admin/includes/post.php b/wp-admin/includes/post.php index 4dc46ac3df..cf8c8e9f01 100644 --- a/wp-admin/includes/post.php +++ b/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 ); diff --git a/wp-includes/version.php b/wp-includes/version.php index 209cc9e719..8eea70f18d 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -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.