Changeset 47219 for trunk/src/wp-includes/comment.php
- Timestamp:
- 02/09/2020 04:52:28 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/comment.php
r47198 r47219 128 128 */ 129 129 if ( 1 == get_option( 'comment_whitelist' ) ) { 130 if ( 'trackback' != $comment_type && 'pingback' != $comment_type && $author != '' && $email != '') {130 if ( 'trackback' !== $comment_type && 'pingback' !== $comment_type && '' != $author && '' != $email ) { 131 131 $comment_user = get_user_by( 'email', wp_unslash( $email ) ); 132 132 if ( ! empty( $comment_user->ID ) ) { … … 218 218 $_comment = apply_filters( 'get_comment', $_comment ); 219 219 220 if ( $output == OBJECT) {220 if ( OBJECT == $output ) { 221 221 return $_comment; 222 } elseif ( $output == ARRAY_A) {222 } elseif ( ARRAY_A == $output ) { 223 223 return $_comment->to_array(); 224 } elseif ( $output == ARRAY_N) {224 } elseif ( ARRAY_N == $output ) { 225 225 return array_values( $_comment->to_array() ); 226 226 } … … 1430 1430 1431 1431 $post_id = $comment->comment_post_ID; 1432 if ( $post_id && $comment->comment_approved == 1) {1432 if ( $post_id && 1 == $comment->comment_approved ) { 1433 1433 wp_update_comment_count( $post_id ); 1434 1434 } … … 1656 1656 $approved = $comment->comment_approved; 1657 1657 1658 if ( $approved == null) {1658 if ( null == $approved ) { 1659 1659 return false; 1660 } elseif ( $approved == '1') {1660 } elseif ( '1' == $approved ) { 1661 1661 return 'approved'; 1662 } elseif ( $approved == '0') {1662 } elseif ( '0' == $approved ) { 1663 1663 return 'unapproved'; 1664 } elseif ( $approved == 'spam') {1664 } elseif ( 'spam' == $approved ) { 1665 1665 return 'spam'; 1666 } elseif ( $approved == 'trash') {1666 } elseif ( 'trash' == $approved ) { 1667 1667 return 'trash'; 1668 1668 } else { … … 1914 1914 $id = (int) $wpdb->insert_id; 1915 1915 1916 if ( $comment_approved == 1) {1916 if ( 1 == $comment_approved ) { 1917 1917 wp_update_comment_count( $comment_post_ID ); 1918 1918 … … 2633 2633 if ( $pingback_link_offset_dquote || $pingback_link_offset_squote ) { 2634 2634 $quote = ( $pingback_link_offset_dquote ) ? '"' : '\''; 2635 $pingback_link_offset = ( $quote == '"') ? $pingback_link_offset_dquote : $pingback_link_offset_squote;2635 $pingback_link_offset = ( '"' === $quote ) ? $pingback_link_offset_dquote : $pingback_link_offset_squote; 2636 2636 $pingback_href_pos = strpos( $contents, 'href=', $pingback_link_offset ); 2637 2637 $pingback_href_start = $pingback_href_pos + 6; … … 2844 2844 if ( isset( $test['query'] ) ) { 2845 2845 $post_links[] = $link_test; 2846 } elseif ( isset( $test['path'] ) && ( $test['path'] != '/' ) && ( $test['path'] != '') ) {2846 } elseif ( isset( $test['path'] ) && ( '/' !== $test['path'] ) && ( '' !== $test['path'] ) ) { 2847 2847 $post_links[] = $link_test; 2848 2848 } … … 3006 3006 */ 3007 3007 function xmlrpc_pingback_error( $ixr_error ) { 3008 if ( $ixr_error->code === 48) {3008 if ( 48 === $ixr_error->code ) { 3009 3009 return $ixr_error; 3010 3010 }
Note: See TracChangeset
for help on using the changeset viewer.