Make WordPress Core


Ignore:
Timestamp:
07/01/2019 12:50:14 PM (6 years ago)
Author:
pento
Message:

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

See #47632.

File:
1 edited

Legend:

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

    r45580 r45583  
    12611261
    12621262        // Associate terms with the same slug in a term group and make slugs unique.
    1263         if ( $exists = $wpdb->get_results( $wpdb->prepare( "SELECT term_id, term_group FROM $wpdb->terms WHERE slug = %s", $slug ) ) ) {
     1263        $exists = $wpdb->get_results( $wpdb->prepare( "SELECT term_id, term_group FROM $wpdb->terms WHERE slug = %s", $slug ) );
     1264        if ( $exists ) {
    12641265            $term_group = $exists[0]->term_group;
    12651266            $id         = $exists[0]->term_id;
     
    13661367
    13671368            // Associate terms with the same slug in a term group and make slugs unique.
    1368             if ( $exists = $wpdb->get_results( $wpdb->prepare( "SELECT term_id, term_group FROM $wpdb->terms WHERE slug = %s", $slug ) ) ) {
     1369            $exists = $wpdb->get_results( $wpdb->prepare( "SELECT term_id, term_group FROM $wpdb->terms WHERE slug = %s", $slug ) );
     1370            if ( $exists ) {
    13691371                $term_group = $exists[0]->term_group;
    13701372                $term_id    = $exists[0]->term_id;
     
    18241826    }
    18251827
    1826     if ( $wp_current_db_version < 22422 && $term = get_term_by( 'slug', 'post-format-standard', 'post_format' ) ) {
    1827         wp_delete_term( $term->term_id, 'post_format' );
     1828    if ( $wp_current_db_version < 22422 ) {
     1829        $term = get_term_by( 'slug', 'post-format-standard', 'post_format' );
     1830        if ( $term ) {
     1831            wp_delete_term( $term->term_id, 'post_format' );
     1832        }
    18281833    }
    18291834}
     
    24312436    global $wpdb;
    24322437    $all_options = new stdClass;
    2433     if ( $options = $wpdb->get_results( "SELECT option_name, option_value FROM $wpdb->options" ) ) {
     2438    $options     = $wpdb->get_results( "SELECT option_name, option_value FROM $wpdb->options" );
     2439    if ( $options ) {
    24342440        foreach ( $options as $option ) {
    24352441            if ( 'siteurl' == $option->option_name || 'home' == $option->option_name || 'category_base' == $option->option_name ) {
     
    26082614
    26092615        // Clear the field and index arrays.
    2610         $cfields = $indices = $indices_without_subparts = array();
     2616        $cfields                  = array();
     2617        $indices                  = array();
     2618        $indices_without_subparts = array();
    26112619
    26122620        // Get all of the field names in the query from between the parentheses.
     
    26832691
    26842692                    // Parse the columns. Multiple columns are separated by a comma.
    2685                     $index_columns = $index_columns_without_subparts = array_map( 'trim', explode( ',', $index_matches['index_columns'] ) );
     2693                    $index_columns                  = array_map( 'trim', explode( ',', $index_matches['index_columns'] ) );
     2694                    $index_columns_without_subparts = $index_columns;
    26862695
    26872696                    // Normalize columns.
     
    28532862
    28542863                // Check if the index definition exists, ignoring subparts.
    2855                 if ( ! ( ( $aindex = array_search( $index_string, $indices_without_subparts ) ) === false ) ) {
     2864                $aindex = array_search( $index_string, $indices_without_subparts );
     2865                if ( false !== $aindex ) {
    28562866                    // If the index already exists (even with different subparts), we don't need to create it.
    28572867                    unset( $indices_without_subparts[ $aindex ] );
Note: See TracChangeset for help on using the changeset viewer.