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:
parent
09dea60c5c
commit
c6af00d8b0
|
@ -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];
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue