Make WordPress Core

Changeset 51850


Ignore:
Timestamp:
09/22/2021 08:59:15 PM (4 months ago)
Author:
johnbillion
Message:

General: Fix code quality issues which were identified by static analysis.

This fixes minor issues that could cause PHP notices under the right conditions, and fixes some general incorrectness.

Props jrf, hellofromTonya for review

See #52217

Location:
trunk/src
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/edit.php

    r51475 r51850  
    155155            $sendback = add_query_arg( 'untrashed', $untrashed, $sendback );
    156156
    157             remove_filter( 'wp_untrash_post_status', 'wp_untrash_post_set_previous_status', 10, 3 );
     157            remove_filter( 'wp_untrash_post_status', 'wp_untrash_post_set_previous_status', 10 );
    158158
    159159            break;
  • trunk/src/wp-admin/includes/class-wp-list-table.php

    r51115 r51850  
    208208     *
    209209     * @param string $name Property to check if set.
    210      * @return bool Whether the property is set.
     210     * @return bool Whether the property is a back-compat property and it is set.
    211211     */
    212212    public function __isset( $name ) {
     
    214214            return isset( $this->$name );
    215215        }
     216
     217        return false;
    216218    }
    217219
     
    314316            return $this->_pagination_args[ $key ];
    315317        }
     318
     319        return 0;
    316320    }
    317321
  • trunk/src/wp-includes/class-wp-http-curl.php

    r49108 r51850  
    308308
    309309        // Handle redirects.
    310         $redirect_response = WP_HTTP::handle_redirects( $url, $parsed_args, $response );
     310        $redirect_response = WP_Http::handle_redirects( $url, $parsed_args, $response );
    311311        if ( false !== $redirect_response ) {
    312312            return $redirect_response;
  • trunk/src/wp-includes/class-wp-http-streams.php

    r51825 r51850  
    471471 * @deprecated 3.7.0 Please use WP_HTTP::request() directly
    472472 */
    473 class WP_HTTP_Fsockopen extends WP_HTTP_Streams {
     473class WP_HTTP_Fsockopen extends WP_Http_Streams {
    474474    // For backward compatibility for users who are using the class directly.
    475475}
  • trunk/src/wp-includes/post.php

    r51837 r51850  
    55075507        return get_post( $foundid, $output );
    55085508    }
     5509
     5510    return null;
    55095511}
    55105512
     
    55645566        return get_post( $page, $output );
    55655567    }
     5568
     5569    return null;
    55665570}
    55675571
  • trunk/src/wp-includes/widgets.php

    r51849 r51850  
    17401740    $show_author  = isset( $widget_rss['show_author'] ) ? (int) $widget_rss['show_author'] : 0;
    17411741    $show_date    = isset( $widget_rss['show_date'] ) ? (int) $widget_rss['show_date'] : 0;
     1742    $error        = false;
     1743    $link         = '';
    17421744
    17431745    if ( $check_feed ) {
    1744         $rss   = fetch_feed( $url );
    1745         $error = false;
    1746         $link  = '';
     1746        $rss = fetch_feed( $url );
     1747
    17471748        if ( is_wp_error( $rss ) ) {
    17481749            $error = $rss->get_error_message();
  • trunk/src/wp-includes/widgets/class-wp-widget-tag-cloud.php

    r50995 r51850  
    5353            }
    5454        }
     55
     56        $default_title = $title;
    5557
    5658        $show_count = ! empty( $instance['count'] );
  • trunk/src/wp-mail.php

    r47580 r51850  
    7878    $post_author               = 1;
    7979    $author_found              = false;
     80    $post_date                 = null;
     81    $post_date_gmt             = null;
     82
    8083    foreach ( $message as $line ) {
    8184        // Body signal.
Note: See TracChangeset for help on using the changeset viewer.