Make WordPress Core

Ticket #58102: 58102.4.diff

File 58102.4.diff, 1.3 KB (added by dhrumilk, 3 years ago)

@audrasjb Please Verify the diff it OK or does need to change.

  • src/wp-includes/revision.php

    diff --git a/src/wp-includes/revision.php b/src/wp-includes/revision.php
    index b4ecf0c863..ca869a94ce 100644
    a b function _show_post_preview() {  
    741741                $id = (int) $_GET['preview_id'];
    742742
    743743                if ( false === wp_verify_nonce( $_GET['preview_nonce'], 'post_preview_' . $id ) ) {
    744                         wp_die( __( 'Sorry, you are not allowed to preview drafts.' ), 403 );
     744                        wp_die( esc_html__( 'Sorry, you are not allowed to preview drafts.' ), 403 );
    745745                }
    746746
    747747                add_filter( 'the_preview', '_set_preview' );
    function _wp_preview_terms_filter( $terms, $post_id, $taxonomy ) {  
    766766                return $terms;
    767767        }
    768768
    769         if ( empty( $_REQUEST['post_format'] ) || $post->ID != $post_id
     769        if ( empty( $_REQUEST['post_format'] ) || $post->ID !== $post_id
    770770                || 'post_format' !== $taxonomy || 'revision' === $post->post_type
    771771        ) {
    772772                return $terms;
    function _wp_preview_post_thumbnail_filter( $value, $post_id, $meta_key ) {  
    804804
    805805        if ( empty( $_REQUEST['_thumbnail_id'] ) ||
    806806                empty( $_REQUEST['preview_id'] ) ||
    807                 $post->ID != $post_id ||
     807                $post->ID !== $post_id ||
    808808                '_thumbnail_id' !== $meta_key ||
    809809                'revision' === $post->post_type ||
    810                 $post_id != $_REQUEST['preview_id'] ) {
     810                $post_id !== $_REQUEST['preview_id'] ) {
    811811
    812812                return $value;
    813813        }