Make WordPress Core

Ticket #27883: 27883.4.diff

File 27883.4.diff, 3.1 KB (added by MikeHansenMe, 12 years ago)

Missed the $info-tested check. Patch updated and minor code cleanup

  • src/wp-admin/update-core.php

     
    246246                }
    247247
    248248                // Get plugin compat for running version of WordPress.
    249                 if ( isset($info->tested) && version_compare($info->tested, $cur_wp_version, '>=') ) {
    250                         $compat = '<br />' . sprintf(__('Compatibility with WordPress %1$s: 100%% (according to its author)'), $cur_wp_version);
    251                 } elseif ( isset($info->compatibility[$cur_wp_version][$plugin_data->update->new_version]) ) {
    252                         $compat = $info->compatibility[$cur_wp_version][$plugin_data->update->new_version];
    253                         $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]);
     249                if ( isset( $info->tested ) && version_compare( $info->tested, $cur_wp_version, '>=' ) ) {
     250                        $compat = '<br />' . sprintf( __( 'Compatibility with WordPress %1$s: 100%% (according to its author)' ), $cur_wp_version );
     251                } elseif ( isset( $info->compatibility[ $cur_wp_version ][ $plugin_data->update->new_version ] ) ) {
     252                        $compat = $info->compatibility[ $cur_wp_version ][ $plugin_data->update->new_version ];
     253                        $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] );
    254254                } else {
    255                         $compat = '<br />' . sprintf(__('Compatibility with WordPress %1$s: Unknown'), $cur_wp_version);
     255                        $compat = '<br />' . sprintf( __( 'Compatibility with WordPress %1$s: Unknown' ), $cur_wp_version );
    256256                }
    257257                // Get plugin compat for updated version of WordPress.
    258258                if ( $core_update_version ) {
    259                         if ( isset($info->compatibility[$core_update_version][$plugin_data->update->new_version]) ) {
    260                                 $update_compat = $info->compatibility[$core_update_version][$plugin_data->update->new_version];
    261                                 $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]);
     259                        if( isset( $info->tested ) && version_compare( $info->tested, $core_update_version, '>=' ) ) {
     260                                $compat = '<br />' . sprintf( __( 'Compatibility with WordPress %1$s: 100%% (according to its author)' ), $core_update_version );
     261                        } elseif ( isset( $info->compatibility[ $core_update_version ][ $plugin_data->update->new_version ]  ) {
     262                                $update_compat = $info->compatibility[ $core_update_version ][ $plugin_data->update->new_version ];
     263                                $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] );
    262264                        } else {
    263                                 $compat .= '<br />' . sprintf(__('Compatibility with WordPress %1$s: Unknown'), $core_update_version);
     265                                $compat .= '<br />' . sprintf( __( 'Compatibility with WordPress %1$s: Unknown' ), $core_update_version );
    264266                        }
    265267                }
    266268                // Get the upgrade notice for the new plugin version.