From 01b4fe872a34424196f239645520040833565836 Mon Sep 17 00:00:00 2001 From: John Blackbourn Date: Thu, 3 Jul 2014 22:31:16 +0000 Subject: [PATCH] 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 --- wp-admin/install.php | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/wp-admin/install.php b/wp-admin/install.php index f9bfb095f3..e2d644ab37 100644 --- a/wp-admin/install.php +++ b/wp-admin/install.php @@ -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 '
'; @@ -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 ) ) {