WordPress.org

Make WordPress Core


Ignore:
Timestamp:
07/02/2019 11:41:16 PM (17 months 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/update.php

    r45412 r45590  
    133133    }
    134134
    135     $url = $http_url = 'http://api.wordpress.org/core/version-check/1.7/?' . http_build_query( $query, null, '&' );
    136     if ( $ssl = wp_http_supports( array( 'ssl' ) ) ) {
     135    $url      = 'http://api.wordpress.org/core/version-check/1.7/?' . http_build_query( $query, null, '&' );
     136    $http_url = $url;
     137    $ssl      = wp_http_supports( array( 'ssl' ) );
     138    if ( $ssl ) {
    137139        $url = set_url_scheme( $url, 'https' );
    138140    }
     
    369371    }
    370372
    371     $url = $http_url = 'http://api.wordpress.org/plugins/update-check/1.1/';
    372     if ( $ssl = wp_http_supports( array( 'ssl' ) ) ) {
     373    $url      = 'http://api.wordpress.org/plugins/update-check/1.1/';
     374    $http_url = $url;
     375    $ssl      = wp_http_supports( array( 'ssl' ) );
     376    if ( $ssl ) {
    373377        $url = set_url_scheme( $url, 'https' );
    374378    }
     
    448452    }
    449453
    450     $themes = $checked = $request = array();
     454    $themes  = array();
     455    $checked = array();
     456    $request = array();
    451457
    452458    // Put slug of current theme into request.
     
    554560    }
    555561
    556     $url = $http_url = 'http://api.wordpress.org/themes/update-check/1.1/';
    557     if ( $ssl = wp_http_supports( array( 'ssl' ) ) ) {
     562    $url      = 'http://api.wordpress.org/themes/update-check/1.1/';
     563    $http_url = $url;
     564    $ssl      = wp_http_supports( array( 'ssl' ) );
     565    if ( $ssl ) {
    558566        $url = set_url_scheme( $url, 'https' );
    559567    }
     
    645653    );
    646654
    647     if ( $plugins = current_user_can( 'update_plugins' ) ) {
     655    $plugins = current_user_can( 'update_plugins' );
     656    if ( $plugins ) {
    648657        $update_plugins = get_site_transient( 'update_plugins' );
    649658        if ( ! empty( $update_plugins->response ) ) {
     
    652661    }
    653662
    654     if ( $themes = current_user_can( 'update_themes' ) ) {
     663    $themes = current_user_can( 'update_themes' );
     664    if ( $themes ) {
    655665        $update_themes = get_site_transient( 'update_themes' );
    656666        if ( ! empty( $update_themes->response ) ) {
     
    659669    }
    660670
    661     if ( ( $core = current_user_can( 'update_core' ) ) && function_exists( 'get_core_updates' ) ) {
     671    $core = current_user_can( 'update_core' );
     672    if ( $core && function_exists( 'get_core_updates' ) ) {
    662673        $update_wordpress = get_core_updates( array( 'dismissed' => false ) );
    663674        if ( ! empty( $update_wordpress ) && ! in_array( $update_wordpress[0]->response, array( 'development', 'latest' ) ) && current_user_can( 'update_core' ) ) {
Note: See TracChangeset for help on using the changeset viewer.