Language Pack Upgrader: Check return value before accessing the first array key.

Prevents a fatal error when Language_Pack_Upgrader::bulk_upgrade() returns a WP_Error object.

fixes #29470.
Built from https://develop.svn.wordpress.org/trunk@29675


git-svn-id: http://core.svn.wordpress.org/trunk@29450 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Dominik Schilling 2014-09-02 18:28:17 +00:00
parent 09dea60c5c
commit c6af00d8b0
1 changed files with 8 additions and 1 deletions

View File

@ -1223,9 +1223,16 @@ class Language_Pack_Upgrader extends WP_Upgrader {
}
public function upgrade( $update = false, $args = array() ) {
if ( $update )
if ( $update ) {
$update = array( $update );
}
$results = $this->bulk_upgrade( $update, $args );
if ( ! is_array( $results ) ) {
return $results;
}
return $results[0];
}