Make WordPress Core


Ignore:
Timestamp:
07/02/2019 11:41:16 PM (7 years ago)
Author:
pento
Message:

Coding Standards: Fix the Squiz.PHP.DisallowMultipleAssignments violations in wp-includes.

See #47632.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/comment.php

    r45424 r45590  
    4949
    5050        // Check for the number of external links if a max allowed number is set.
    51         if ( $max_links = get_option( 'comment_max_links' ) ) {
     51        $max_links = get_option( 'comment_max_links' );
     52        if ( $max_links ) {
    5253                $num_links = preg_match_all( '/<a [^>]*href/i', $comment, $out );
    5354
     
    10391040        $page = null;
    10401041
    1041         if ( ! $comment = get_comment( $comment_ID ) ) {
     1042        $comment = get_comment( $comment_ID );
     1043        if ( ! $comment ) {
    10421044                return;
    10431045        }
     
    13601362function wp_delete_comment( $comment_id, $force_delete = false ) {
    13611363        global $wpdb;
    1362         if ( ! $comment = get_comment( $comment_id ) ) {
     1364        $comment = get_comment( $comment_id );
     1365        if ( ! $comment ) {
    13631366                return false;
    13641367        }
     
    14361439        }
    14371440
    1438         if ( ! $comment = get_comment( $comment_id ) ) {
     1441        $comment = get_comment( $comment_id );
     1442        if ( ! $comment ) {
    14391443                return false;
    14401444        }
     
    20492053
    20502054        if ( isset( $commentdata['user_ID'] ) ) {
    2051                 $commentdata['user_id'] = $commentdata['user_ID'] = (int) $commentdata['user_ID'];
     2055                $commentdata['user_ID'] = (int) $commentdata['user_ID'];
     2056                $commentdata['user_id'] = $commentdata['user_ID'];
    20522057        }
    20532058
     
    20652070        $commentdata['comment_post_ID'] = (int) $commentdata['comment_post_ID'];
    20662071        if ( isset( $commentdata['user_ID'] ) && $prefiltered_user_id !== (int) $commentdata['user_ID'] ) {
    2067                 $commentdata['user_id'] = $commentdata['user_ID'] = (int) $commentdata['user_ID'];
     2072                $commentdata['user_ID'] = (int) $commentdata['user_ID'];
     2073                $commentdata['user_id'] = $commentdata['user_ID'];
    20682074        } elseif ( isset( $commentdata['user_id'] ) ) {
    20692075                $commentdata['user_id'] = (int) $commentdata['user_id'];
     
    24762482        wp_cache_delete( "comments-{$post_id}", 'counts' );
    24772483
    2478         if ( ! $post = get_post( $post_id ) ) {
     2484        $post = get_post( $post_id );
     2485        if ( ! $post ) {
    24792486                return false;
    24802487        }
     
    27752782                if ( ! in_array( $link_test, $pung ) && ( url_to_postid( $link_test ) != $post->ID ) // If we haven't pung it already and it isn't a link to itself
    27762783                                && ! is_local_attachment( $link_test ) ) : // Also, let's never ping local attachments.
    2777                         if ( $test = @parse_url( $link_test ) ) {
     2784                        $test = @parse_url( $link_test );
     2785                        if ( $test ) {
    27782786                                if ( isset( $test['query'] ) ) {
    27792787                                        $post_links[] = $link_test;
     
    31353143function wp_handle_comment_submission( $comment_data ) {
    31363144
    3137         $comment_post_ID = $comment_parent = $user_ID = 0;
    3138         $comment_author  = $comment_author_email = $comment_author_url = $comment_content = null;
     3145        $comment_post_ID      = 0;
     3146        $comment_parent       = 0;
     3147        $user_ID              = 0;
     3148        $comment_author       = null;
     3149        $comment_author_email = null;
     3150        $comment_author_url   = null;
     3151        $comment_content      = null;
    31393152
    31403153        if ( isset( $comment_data['comment_post_ID'] ) ) {
Note: See TracChangeset for help on using the changeset viewer.