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

Built from https://develop.svn.wordpress.org/trunk@28982


git-svn-id: http://core.svn.wordpress.org/trunk@28771 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
John Blackbourn 2014-07-03 22:31:16 +00:00
parent 2f399f18b7
commit 01b4fe872a
1 changed files with 9 additions and 5 deletions

View File

@ -200,7 +200,8 @@ if ( ! is_string( $wpdb->base_prefix ) || '' === $wpdb->base_prefix ) {
switch($step) {
case 0: // Step 0
if ( $body = wp_get_available_translations() ) {
$body = wp_get_available_translations();
if ( $body ) {
display_header( 'language-chooser' );
echo '<form id="setup" method="post" action="install.php?step=1">';
@ -219,10 +220,13 @@ switch($step) {
case 1: // Step 1, direct link or from language chooser.
if ( ! empty( $_POST['language'] ) ) {
$body = wp_get_available_translations();
foreach ( $body['languages'] as $language ) {
if ( $language['language'] === $_POST['language'] ) {
$loading_language = $_POST['language'];
break;
$loading_language = false;
if ( $body ) {
foreach ( $body['languages'] as $language ) {
if ( $language['language'] === $_POST['language'] ) {
$loading_language = $_POST['language'];
break;
}
}
}
if ( ! empty( $loading_language ) ) {