Make WordPress Core

Ticket #58102: 58102.3.diff

File 58102.3.diff, 1.3 KB (added by viralsampat, 3 years ago)

I have found one another file and added patch for the same.

  • src/wp-includes/revision.php

    diff --git a/src/wp-includes/revision.php b/src/wp-includes/revision.php
    index 0f76f908f1..e490a05622 100644
    a b function _show_post_preview() {  
    726726                $id = (int) $_GET['preview_id'];
    727727
    728728                if ( false === wp_verify_nonce( $_GET['preview_nonce'], 'post_preview_' . $id ) ) {
    729                         wp_die( __( 'Sorry, you are not allowed to preview drafts.' ), 403 );
     729                        wp_die( esc_html_e( 'Sorry, you are not allowed to preview drafts.' ), 403 );
    730730                }
    731731
    732732                add_filter( 'the_preview', '_set_preview' );
    function _wp_preview_terms_filter( $terms, $post_id, $taxonomy ) {  
    751751                return $terms;
    752752        }
    753753
    754         if ( empty( $_REQUEST['post_format'] ) || $post->ID != $post_id
     754        if ( empty( $_REQUEST['post_format'] ) || $post->ID !== $post_id
    755755                || 'post_format' !== $taxonomy || 'revision' === $post->post_type
    756756        ) {
    757757                return $terms;
    function _wp_preview_post_thumbnail_filter( $value, $post_id, $meta_key ) {  
    789789
    790790        if ( empty( $_REQUEST['_thumbnail_id'] ) ||
    791791                empty( $_REQUEST['preview_id'] ) ||
    792                 $post->ID != $post_id ||
     792                $post->ID !== $post_id ||
    793793                '_thumbnail_id' !== $meta_key ||
    794794                'revision' === $post->post_type ||
    795                 $post_id != $_REQUEST['preview_id'] ) {
     795                $post_id !== $_REQUEST['preview_id'] ) {
    796796
    797797                return $value;
    798798        }