Posts: Set a HTTP 403 error when an incorrect post preview nonce is sent.

Props graymouser.
Fixes #43570.


Built from https://develop.svn.wordpress.org/trunk@44610


git-svn-id: http://core.svn.wordpress.org/trunk@44441 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Gary Pendergast 2019-01-16 03:54:50 +00:00
parent 6f723ddf50
commit dd9442ae6c
2 changed files with 2 additions and 2 deletions

View File

@ -582,7 +582,7 @@ function _show_post_preview() {
$id = (int) $_GET['preview_id'];
if ( false === wp_verify_nonce( $_GET['preview_nonce'], 'post_preview_' . $id ) ) {
wp_die( __( 'Sorry, you are not allowed to preview drafts.' ) );
wp_die( __( 'Sorry, you are not allowed to preview drafts.' ), 403 );
}
add_filter( 'the_preview', '_set_preview' );

View File

@ -13,7 +13,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.1-beta1-44609';
$wp_version = '5.1-beta1-44610';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.