Make WordPress Core

Ticket #49239: comment.php.2.patch

File comment.php.2.patch, 1.8 KB (added by pikamander2, 6 years ago)
  • comment.php

     
    2222        $action = 'deletecomment';
    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        }
    3737}
     
    7171                        comment_footer_die( __( 'Sorry, you are not allowed to edit this comment.' ) );
    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                }
    7777
     
    101101                }
    102102
    103103                // No need to re-approve/re-trash/re-spam a comment.
    104                 if ( $action == str_replace( '1', 'approve', $comment->comment_approved ) ) {
     104                if ( $action === str_replace( '1', 'approve', $comment->comment_approved ) ) {
    105105                        wp_redirect( admin_url( 'edit-comments.php?same=' . $comment_id ) );
    106106                        die();
    107107                }
     
    109109                require_once( ABSPATH . 'wp-admin/admin-header.php' );
    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
    115115                ?>
     
    137137                                break;
    138138                }
    139139
    140                 if ( $comment->comment_approved != '0' ) { // if not unapproved
     140                if ( '0' != $comment->comment_approved ) { // if not unapproved
    141141                        $message = '';
    142142                        switch ( $comment->comment_approved ) {
    143143                                case '1':