WordPress.org

Make WordPress Core

Ticket #29583: 29583.patch

File 29583.patch, 2.3 KB (added by SergeyBiryukov, 7 years ago)
  • src/wp-admin/update-core.php

     
    242242        foreach ( (array) $plugins as $plugin_file => $plugin_data) {
    243243                $info = plugins_api('plugin_information', array('slug' => $plugin_data->update->slug ));
    244244                // Get plugin compat for running version of WordPress.
    245                 if ( isset($info->tested) && version_compare($info->tested, $cur_wp_version, '>=') ) {
     245                if ( isset( $info->tested ) && version_compare( $info->tested, $cur_wp_version, '>=' ) ) {
    246246                        $compat = '<br />' . sprintf(__('Compatibility with WordPress %1$s: 100%% (according to its author)'), $cur_wp_version);
    247                 } elseif ( isset($info->compatibility[$cur_wp_version][$plugin_data->update->new_version]) ) {
    248                         $compat = $info->compatibility[$cur_wp_version][$plugin_data->update->new_version];
     247                } elseif ( isset( $info->compatibility ) && isset( $info->compatibility[ $cur_wp_version ][ $plugin_data->update->new_version ] ) ) {
     248                        $compat = $info->compatibility[ $cur_wp_version ][ $plugin_data->update->new_version ];
    249249                        $compat = '<br />' . sprintf(__('Compatibility with WordPress %1$s: %2$d%% (%3$d "works" votes out of %4$d total)'), $cur_wp_version, $compat[0], $compat[2], $compat[1]);
    250250                } else {
    251251                        $compat = '<br />' . sprintf(__('Compatibility with WordPress %1$s: Unknown'), $cur_wp_version);
     
    252252                }
    253253                // Get plugin compat for updated version of WordPress.
    254254                if ( $core_update_version ) {
    255                         if ( isset($info->compatibility[$core_update_version][$plugin_data->update->new_version]) ) {
    256                                 $update_compat = $info->compatibility[$core_update_version][$plugin_data->update->new_version];
     255                        if ( isset( $info->compatibility ) && isset( $info->compatibility[ $core_update_version ][ $plugin_data->update->new_version ] ) ) {
     256                                $update_compat = $info->compatibility[ $core_update_version ][ $plugin_data->update->new_version ];
    257257                                $compat .= '<br />' . sprintf(__('Compatibility with WordPress %1$s: %2$d%% (%3$d "works" votes out of %4$d total)'), $core_update_version, $update_compat[0], $update_compat[2], $update_compat[1]);
    258258                        } else {
    259259                                $compat .= '<br />' . sprintf(__('Compatibility with WordPress %1$s: Unknown'), $core_update_version);