Pass along preview query args only if they are already present. Avoids sloppily appending a preview nonce when there should not be one. See #17157.

git-svn-id: https://develop.svn.wordpress.org/trunk@27334 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
John Blackbourn 2014-02-28 23:28:44 +00:00
parent 85079f08b7
commit 54a8eff27a

View File

@ -719,10 +719,10 @@ function _wp_link_page( $i ) {
'preview' => 'true'
), $url );
if ( 'draft' !== $post->post_status ) {
if ( ( 'draft' !== $post->post_status ) && isset( $_GET['preview_id'], $_GET['preview_nonce'] ) ) {
$url = add_query_arg( array(
'preview_id' => $post->ID,
'preview_nonce' => wp_create_nonce( 'post_preview_' . $post->ID )
'preview_id' => wp_unslash( $_GET['preview_id'] ),
'preview_nonce' => wp_unslash( $_GET['preview_nonce'] )
), $url );
}
}