WordPress.org

Make WordPress Core

Changeset 28982


Ignore:
Timestamp:
07/03/14 22:30:27 (3 years ago)
Author:
johnbillion
Message:

Avoid a warning if the translations API call fails on step 1. Remove assignment inside an if statement. See #28577.

File:
1 edited

Legend:

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

    r28906 r28982  
    201201switch($step) { 
    202202    case 0: // Step 0 
    203         if ( $body = wp_get_available_translations() ) { 
     203        $body = wp_get_available_translations(); 
     204        if ( $body ) { 
    204205            display_header( 'language-chooser' ); 
    205206 
     
    220221        if ( ! empty( $_POST['language'] ) ) { 
    221222            $body = wp_get_available_translations(); 
    222             foreach ( $body['languages'] as $language ) { 
    223                 if ( $language['language'] === $_POST['language'] ) { 
    224                     $loading_language = $_POST['language']; 
    225                     break; 
     223            $loading_language = false; 
     224            if ( $body ) { 
     225                foreach ( $body['languages'] as $language ) { 
     226                    if ( $language['language'] === $_POST['language'] ) { 
     227                        $loading_language = $_POST['language']; 
     228                        break; 
     229                    } 
    226230                } 
    227231            } 
Note: See TracChangeset for help on using the changeset viewer.