Make WordPress Core


Ignore:
Timestamp:
05/12/2020 06:30:03 PM (5 years ago)
Author:
SergeyBiryukov
Message:

Coding Standards: Use strict comparison in some wp-admin files.

Props pikamander2, mukesh27, SergeyBiryukov.
Fixes #49239.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/comment.php

    r47550 r47785  
    2323}
    2424
    25 if ( 'cdc' == $action ) {
     25if ( 'cdc' === $action ) {
    2626    $action = 'delete';
    27 } elseif ( 'mac' == $action ) {
     27} elseif ( 'mac' === $action ) {
    2828    $action = 'approve';
    2929}
    3030
    3131if ( isset( $_GET['dt'] ) ) {
    32     if ( 'spam' == $_GET['dt'] ) {
     32    if ( 'spam' === $_GET['dt'] ) {
    3333        $action = 'spam';
    34     } elseif ( 'trash' == $_GET['dt'] ) {
     34    } elseif ( 'trash' === $_GET['dt'] ) {
    3535        $action = 'trash';
    3636    }
     
    7272        }
    7373
    74         if ( 'trash' == $comment->comment_approved ) {
     74        if ( 'trash' === $comment->comment_approved ) {
    7575            comment_footer_die( __( 'This comment is in the Trash. Please move it out of the Trash if you want to edit it.' ) );
    7676        }
     
    102102
    103103        // No need to re-approve/re-trash/re-spam a comment.
    104         if ( str_replace( '1', 'approve', $comment->comment_approved ) == $action ) {
     104        if ( str_replace( '1', 'approve', $comment->comment_approved ) === $action ) {
    105105            wp_redirect( admin_url( 'edit-comments.php?same=' . $comment_id ) );
    106106            die();
     
    110110
    111111        $formaction    = $action . 'comment';
    112         $nonce_action  = 'approve' == $action ? 'approve-comment_' : 'delete-comment_';
     112        $nonce_action  = ( 'approve' === $action ) ? 'approve-comment_' : 'delete-comment_';
    113113        $nonce_action .= $comment_id;
    114114
     
    138138        }
    139139
    140         if ( '0' != $comment->comment_approved ) { // If not unapproved.
     140        if ( '0' !== $comment->comment_approved ) { // If not unapproved.
    141141            $message = '';
    142142            switch ( $comment->comment_approved ) {
     
    272272        }
    273273
    274         if ( '' != wp_get_referer() && ! $noredir && false === strpos( wp_get_referer(), 'comment.php' ) ) {
     274        if ( wp_get_referer() && ! $noredir && false === strpos( wp_get_referer(), 'comment.php' ) ) {
    275275            $redir = wp_get_referer();
    276         } elseif ( '' != wp_get_original_referer() && ! $noredir ) {
     276        } elseif ( wp_get_original_referer() && ! $noredir ) {
    277277            $redir = wp_get_original_referer();
    278278        } elseif ( in_array( $action, array( 'approvecomment', 'unapprovecomment' ), true ) ) {
     
    349349         */
    350350        $location = apply_filters( 'comment_edit_redirect', $location, $comment_id );
     351
    351352        wp_redirect( $location );
    352 
    353         exit();
     353        exit;
    354354
    355355    default:
Note: See TracChangeset for help on using the changeset viewer.