WordPress.org

Make WordPress Core

Ticket #22898: update.diff

File update.diff, 1.0 KB (added by warrenholmes, 2 years ago)
  • update.php

     
    158158        $upgrade_plugins = array(); 
    159159        $current = get_site_transient( 'update_plugins' ); 
    160160        foreach ( (array)$all_plugins as $plugin_file => $plugin_data) { 
    161                 if ( isset( $current->response[ $plugin_file ] ) ) { 
     161                if ( isset( $current->response[ $plugin_file ] ) && is_object( $current->response[ $plugin_file ] ) && !empty( $current->response[ $plugin_file ]->new_version ) ) { 
    162162                        $upgrade_plugins[ $plugin_file ] = (object) $plugin_data; 
    163163                        $upgrade_plugins[ $plugin_file ]->update = $current->response[ $plugin_file ]; 
    164164                } 
     
    183183 
    184184function wp_plugin_update_row( $file, $plugin_data ) { 
    185185        $current = get_site_transient( 'update_plugins' ); 
    186         if ( !isset( $current->response[ $file ] ) ) 
     186        if ( !isset( $current->response[ $file ] ) || !is_object( $current->response[ $file ] ) || empty( $current->response[ $file ]->new_version ) ) 
    187187                return false; 
    188188 
    189189        $r = $current->response[ $file ];