Changeset 47785 for trunk/src/wp-admin/comment.php
- Timestamp:
- 05/12/2020 06:30:03 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/comment.php
r47550 r47785 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 } … … 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 } … … 102 102 103 103 // 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 ) { 105 105 wp_redirect( admin_url( 'edit-comments.php?same=' . $comment_id ) ); 106 106 die(); … … 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 … … 138 138 } 139 139 140 if ( '0' != $comment->comment_approved ) { // If not unapproved.140 if ( '0' !== $comment->comment_approved ) { // If not unapproved. 141 141 $message = ''; 142 142 switch ( $comment->comment_approved ) { … … 272 272 } 273 273 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' ) ) { 275 275 $redir = wp_get_referer(); 276 } elseif ( '' !=wp_get_original_referer() && ! $noredir ) {276 } elseif ( wp_get_original_referer() && ! $noredir ) { 277 277 $redir = wp_get_original_referer(); 278 278 } elseif ( in_array( $action, array( 'approvecomment', 'unapprovecomment' ), true ) ) { … … 349 349 */ 350 350 $location = apply_filters( 'comment_edit_redirect', $location, $comment_id ); 351 351 352 wp_redirect( $location ); 352 353 exit(); 353 exit; 354 354 355 355 default:
Note: See TracChangeset
for help on using the changeset viewer.