mirror of
https://github.com/WordPress/WordPress.git
synced 2024-09-28 15:17:42 +02:00
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:
parent
bc3d8197aa
commit
60c26865f9
@ -1667,7 +1667,7 @@ function post_preview() {
|
|||||||
} else {
|
} else {
|
||||||
$is_autosave = true;
|
$is_autosave = true;
|
||||||
|
|
||||||
if ( 'auto-draft' == $_POST['post_status'] )
|
if ( isset( $_POST['post_status'] ) && 'auto-draft' == $_POST['post_status'] )
|
||||||
$_POST['post_status'] = 'draft';
|
$_POST['post_status'] = 'draft';
|
||||||
|
|
||||||
$saved_post_id = wp_create_post_autosave( $post->ID );
|
$saved_post_id = wp_create_post_autosave( $post->ID );
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @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.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
Loading…
Reference in New Issue
Block a user