Index: wp-admin/includes/theme-install.php
===================================================================
--- wp-admin/includes/theme-install.php (revision 10915)
+++ wp-admin/includes/theme-install.php (working copy)
@@ -97,6 +97,8 @@
* @param string $page
*/
function install_theme_search($page) {
+ global $theme_field_defaults;
+
$type = isset($_REQUEST['type']) ? stripslashes( $_REQUEST['type'] ) : '';
$term = isset($_REQUEST['s']) ? stripslashes( $_REQUEST['s'] ) : '';
@@ -398,16 +400,12 @@
?>
$cols ) {
?>
@@ -419,10 +417,10 @@
if ( $col == 1 ) $class[] = 'left';
if ( $row == $rows ) $class[] = 'bottom';
if ( $col == 3 ) $class[] = 'right';
- $theme = $themes[$theme_index];
?>
|
@@ -467,20 +465,20 @@
exit;
}
- if ( version_compare($GLOBALS['wp_version'], $api->tested, '>') )
+ if ( !empty($api->tested) && version_compare($GLOBALS['wp_version'], $api->tested, '>') )
echo '' . __('Warning: This theme has not been tested with your current version of WordPress.') . '
';
- else if ( version_compare($GLOBALS['wp_version'], $api->requires, '<') )
+ else if ( !empty($api->requires) && version_compare($GLOBALS['wp_version'], $api->requires, '<') )
echo '' . __('Warning: This theme has not been marked as compatible with your version of WordPress.') . '
';
// Default to a "new" theme
$type = 'install';
// Check to see if this theme is known to be installed, and has an update awaiting it.
$update_themes = get_transient('update_themes');
- if ( is_object($update_themes) ) {
- foreach ( (array)$update_themes->response as $file => $theme ) {
- if ( $theme->slug === $api->slug ) {
+ if ( is_object($update_themes) && isset($update_themes->response) ) {
+ foreach ( (array)$update_themes->response as $theme_slug => $theme_info ) {
+ if ( $theme_slug === $api->slug ) {
$type = 'update_available';
- $update_file = $file;
+ $update_file = $theme_slug;
break;
}
}
Index: wp-admin/themes.php
===================================================================
--- wp-admin/themes.php (revision 10915)
+++ wp-admin/themes.php (working copy)
@@ -93,15 +93,16 @@
if ( isset($themes_update->response[ $stylesheet ]) ) {
$update = $themes_update->response[ $stylesheet ];
+ $theme_name = is_object($theme) ? $theme->name : (is_array($theme) ? $theme['Name'] : '')
$details_url = add_query_arg(array('TB_iframe' => 'true', 'width' => 1024, 'height' => 800), $update['url']); //Theme browser inside WP? replace this, Also, theme preview JS will override this on the available list.
$update_url = wp_nonce_url('update.php?action=upgrade-theme&theme=' . urlencode($stylesheet), 'upgrade-theme_' . $stylesheet);
if ( ! current_user_can('update_themes') )
- printf( __('There is a new version of %1$s available. View version %3$s Details.
'), $ct->name, $details_url, $update['new_version']);
+ printf( __('There is a new version of %1$s available. View version %3$s Details.
'), $theme_name, $details_url, $update['new_version']);
else if ( empty($update->package) )
- printf( __('There is a new version of %1$s available. View version %3$s Details automatic upgrade unavailable for this theme.
'), $ct->name, $details_url, $update['new_version']);
+ printf( __('There is a new version of %1$s available. View version %3$s Details automatic upgrade unavailable for this theme.
'), $theme_name, $details_url, $update['new_version']);
else
- printf( __('There is a new version of %1$s available. View version %3$s Details or upgrade automatically.
'), $ct->name, $details_url, $update['new_version'], $update_url );
+ printf( __('There is a new version of %1$s available. View version %3$s Details or upgrade automatically.
'), $theme_name, $details_url, $update['new_version'], $update_url );
}
}