Make WordPress Core

Ticket #49239: media.php.patch

File media.php.patch, 929 bytes (added by pikamander2, 6 years ago)
  • media.php

     
    2929                        $location = 'media.php';
    3030                        $referer  = wp_get_original_referer();
    3131                        if ( $referer ) {
    32                                 if ( false !== strpos( $referer, 'upload.php' ) || ( url_to_postid( $referer ) == $attachment_id ) ) {
     32                                if ( false !== strpos( $referer, 'upload.php' ) || ( url_to_postid( $referer ) === $attachment_id ) ) {
    3333                                        $location = $referer;
    3434                                }
    3535                        }
     
    6969                if ( 'attachment' !== $att->post_type ) {
    7070                        wp_die( __( 'You attempted to edit an item that isn’t an attachment. Please go back and try again.' ) );
    7171                }
    72                 if ( $att->post_status == 'trash' ) {
     72                if ( $att->post_status === 'trash' ) {
    7373                        wp_die( __( 'You can’t edit this attachment because it is in the Trash. Please move it out of the Trash and try again.' ) );
    7474                }
    7575