Ticket #49239: comment.php.2.patch
| File comment.php.2.patch, 1.8 KB (added by , 6 years ago) |
|---|
-
comment.php
22 22 $action = 'deletecomment'; 23 23 } 24 24 25 if ( 'cdc' == $action ) {25 if ( 'cdc' === $action ) { 26 26 $action = 'delete'; 27 } elseif ( 'mac' == $action ) {27 } elseif ( 'mac' === $action ) { 28 28 $action = 'approve'; 29 29 } 30 30 31 31 if ( isset( $_GET['dt'] ) ) { 32 if ( 'spam' == $_GET['dt'] ) {32 if ( 'spam' === $_GET['dt'] ) { 33 33 $action = 'spam'; 34 } elseif ( 'trash' == $_GET['dt'] ) {34 } elseif ( 'trash' === $_GET['dt'] ) { 35 35 $action = 'trash'; 36 36 } 37 37 } … … 71 71 comment_footer_die( __( 'Sorry, you are not allowed to edit this comment.' ) ); 72 72 } 73 73 74 if ( 'trash' == $comment->comment_approved ) {74 if ( 'trash' === $comment->comment_approved ) { 75 75 comment_footer_die( __( 'This comment is in the Trash. Please move it out of the Trash if you want to edit it.' ) ); 76 76 } 77 77 … … 101 101 } 102 102 103 103 // 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 ) ) { 105 105 wp_redirect( admin_url( 'edit-comments.php?same=' . $comment_id ) ); 106 106 die(); 107 107 } … … 109 109 require_once( ABSPATH . 'wp-admin/admin-header.php' ); 110 110 111 111 $formaction = $action . 'comment'; 112 $nonce_action = 'approve' == $action ? 'approve-comment_' : 'delete-comment_';112 $nonce_action = 'approve' === $action ? 'approve-comment_' : 'delete-comment_'; 113 113 $nonce_action .= $comment_id; 114 114 115 115 ?> … … 137 137 break; 138 138 } 139 139 140 if ( $comment->comment_approved != '0') { // if not unapproved140 if ( '0' != $comment->comment_approved ) { // if not unapproved 141 141 $message = ''; 142 142 switch ( $comment->comment_approved ) { 143 143 case '1':