WordPress.org

Make WordPress Core

Changeset 29675


Ignore:
Timestamp:
09/02/2014 06:27:12 PM (5 years ago)
Author:
ocean90
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-wp-upgrader.php

    r29622 r29675  
    12241224
    12251225    public function upgrade( $update = false, $args = array() ) {
    1226         if ( $update )
     1226        if ( $update ) {
    12271227            $update = array( $update );
     1228        }
     1229
    12281230        $results = $this->bulk_upgrade( $update, $args );
     1231
     1232        if ( ! is_array( $results ) ) {
     1233            return $results;
     1234        }
     1235
    12291236        return $results[0];
    12301237    }
Note: See TracChangeset for help on using the changeset viewer.