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.

git-svn-id: https://develop.svn.wordpress.org/trunk@29675 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Dominik Schilling (ocean90) 2014-09-02 18:27:12 +00:00
parent 3ae3ae5ab2
commit 1c82a3bf80
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];
}