Changeset 47808 for trunk/src/wp-includes/comment.php
- Timestamp:
- 05/16/2020 06:40:52 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/comment.php
r47626 r47808 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 ) ) { … … 964 964 'pings' => array(), 965 965 ); 966 $count = count( $comments ); 966 967 $count = count( $comments ); 968 967 969 for ( $i = 0; $i < $count; $i++ ) { 968 970 $type = $comments[ $i ]->comment_type; 971 969 972 if ( empty( $type ) ) { 970 973 $type = 'comment'; 971 974 } 975 972 976 $comments_by_type[ $type ][] = &$comments[ $i ]; 973 if ( 'trackback' == $type || 'pingback' == $type ) { 977 978 if ( 'trackback' === $type || 'pingback' === $type ) { 974 979 $comments_by_type['pings'][] = &$comments[ $i ]; 975 980 } … … 1282 1287 1283 1288 $mod_keys = trim( get_option( 'blacklist_keys' ) ); 1284 if ( '' == $mod_keys ) {1289 if ( '' === $mod_keys ) { 1285 1290 return false; // If moderation keys are empty. 1286 1291 } … … 1672 1677 } elseif ( '0' == $approved ) { 1673 1678 return 'unapproved'; 1674 } elseif ( 'spam' == $approved ) {1679 } elseif ( 'spam' === $approved ) { 1675 1680 return 'spam'; 1676 } elseif ( 'trash' == $approved ) {1681 } elseif ( 'trash' === $approved ) { 1677 1682 return 'trash'; 1678 1683 } else { … … 2115 2120 2116 2121 $commentdata['comment_parent'] = isset( $commentdata['comment_parent'] ) ? absint( $commentdata['comment_parent'] ) : 0; 2117 $parent_status = ( 0 < $commentdata['comment_parent'] ) ? wp_get_comment_status( $commentdata['comment_parent'] ) : ''; 2118 $commentdata['comment_parent'] = ( 'approved' == $parent_status || 'unapproved' == $parent_status ) ? $commentdata['comment_parent'] : 0; 2122 2123 $parent_status = ( $commentdata['comment_parent'] > 0 ) ? wp_get_comment_status( $commentdata['comment_parent'] ) : ''; 2124 2125 $commentdata['comment_parent'] = ( 'approved' === $parent_status || 'unapproved' === $parent_status ) ? $commentdata['comment_parent'] : 0; 2119 2126 2120 2127 if ( ! isset( $commentdata['comment_author_IP'] ) ) { … … 2376 2383 if ( ! isset( $data['comment_approved'] ) ) { 2377 2384 $data['comment_approved'] = 1; 2378 } elseif ( 'hold' == $data['comment_approved'] ) {2385 } elseif ( 'hold' === $data['comment_approved'] ) { 2379 2386 $data['comment_approved'] = 0; 2380 } elseif ( 'approve' == $data['comment_approved'] ) {2387 } elseif ( 'approve' === $data['comment_approved'] ) { 2381 2388 $data['comment_approved'] = 1; 2382 2389 } … … 2801 2808 foreach ( (array) $services as $service ) { 2802 2809 $service = trim( $service ); 2803 if ( '' != $service ) {2810 if ( '' !== $service ) { 2804 2811 weblog_ping( $service ); 2805 2812 } … … 2986 2993 2987 2994 // Using a timeout of 3 seconds should be enough to cover slow servers. 2988 $client = new WP_HTTP_IXR_Client( $server, ( ( ! strlen( trim( $path ) ) || ( '/' == $path ) ) ? false : $path ) );2995 $client = new WP_HTTP_IXR_Client( $server, ( ( ! strlen( trim( $path ) ) || ( '/' === $path ) ) ? false : $path ) ); 2989 2996 $client->timeout = 3; 2990 2997 $client->useragent .= ' -- WordPress/' . get_bloginfo( 'version' ); … … 3267 3274 $status = get_post_status( $post ); 3268 3275 3269 if ( ( 'private' == $status ) && ! current_user_can( 'read_post', $comment_post_ID ) ) {3276 if ( ( 'private' === $status ) && ! current_user_can( 'read_post', $comment_post_ID ) ) { 3270 3277 return new WP_Error( 'comment_id_not_found' ); 3271 3278 } … … 3286 3293 return new WP_Error( 'comment_closed', __( 'Sorry, comments are closed for this item.' ), 403 ); 3287 3294 3288 } elseif ( 'trash' == $status ) {3295 } elseif ( 'trash' === $status ) { 3289 3296 3290 3297 /**
Note: See TracChangeset
for help on using the changeset viewer.