Make WordPress Core

Ticket #9508: 9508.diff

File 9508.diff, 1.8 KB (added by DD32, 16 years ago)
  • wp-admin/includes/theme-install.php

     
    9797 * @param string $page
    9898 */
    9999function install_theme_search($page) {
     100        global $theme_field_defaults;
     101
    100102        $type = isset($_REQUEST['type']) ? stripslashes( $_REQUEST['type'] ) : '';
    101103        $term = isset($_REQUEST['s']) ? stripslashes( $_REQUEST['s'] ) : '';
    102104
     
    467469                exit;
    468470        }
    469471
    470         if ( version_compare($GLOBALS['wp_version'], $api->tested, '>') )
     472        if ( !empty($api->tested) && version_compare($GLOBALS['wp_version'], $api->tested, '>') )
    471473                echo '<div class="updated"><p>' . __('<strong>Warning:</strong> This theme has <strong>not been tested</strong> with your current version of WordPress.') . '</p></div>';
    472         else if ( version_compare($GLOBALS['wp_version'], $api->requires, '<') )
     474        else if ( !empty($api->requires) && version_compare($GLOBALS['wp_version'], $api->requires, '<') )
    473475                echo '<div class="updated"><p>' . __('<strong>Warning:</strong> This theme has not been marked as <strong>compatible</strong> with your version of WordPress.') . '</p></div>';
    474476
    475477        // Default to a "new" theme
     
    477479        // Check to see if this theme is known to be installed, and has an update awaiting it.
    478480        $update_themes = get_transient('update_themes');
    479481        if ( is_object($update_themes) ) {
    480                 foreach ( (array)$update_themes->response as $file => $theme ) {
    481                         if ( $theme->slug === $api->slug ) {
     482                foreach ( (array)$update_themes->response as $theme_slug => $theme_info ) {
     483                        if ( $theme_slug === $api->slug ) {
    482484                                $type = 'update_available';
    483                                 $update_file = $file;
     485                                $update_file = $theme_slug;
    484486                                break;
    485487                        }
    486488                }