Ticket #9508: 9508.diff
File 9508.diff, 1.8 KB (added by , 16 years ago) |
---|
-
wp-admin/includes/theme-install.php
97 97 * @param string $page 98 98 */ 99 99 function install_theme_search($page) { 100 global $theme_field_defaults; 101 100 102 $type = isset($_REQUEST['type']) ? stripslashes( $_REQUEST['type'] ) : ''; 101 103 $term = isset($_REQUEST['s']) ? stripslashes( $_REQUEST['s'] ) : ''; 102 104 … … 467 469 exit; 468 470 } 469 471 470 if ( version_compare($GLOBALS['wp_version'], $api->tested, '>') )472 if ( !empty($api->tested) && version_compare($GLOBALS['wp_version'], $api->tested, '>') ) 471 473 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, '<') ) 473 475 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>'; 474 476 475 477 // Default to a "new" theme … … 477 479 // Check to see if this theme is known to be installed, and has an update awaiting it. 478 480 $update_themes = get_transient('update_themes'); 479 481 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 ) { 482 484 $type = 'update_available'; 483 $update_file = $ file;485 $update_file = $theme_slug; 484 486 break; 485 487 } 486 488 }