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
This commit is contained in:
parent
5d50b55c7e
commit
151520ee02
@ -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 );
|
||||||
|
Loading…
x
Reference in New Issue
Block a user