Ticket #9393: 9393_theme-install.patch
File 9393_theme-install.patch, 2.6 KB (added by , 16 years ago) |
---|
-
wp-admin/includes/theme-install.php
96 96 * 97 97 * @param string $page 98 98 */ 99 function install_theme_search($page) { 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 … … 362 364 * @param string $page 363 365 * @param int $totalpages Number of pages. 364 366 */ 365 function display_themes( $themes, $page = 1, $totalpages = 1) {367 function display_themes( $themes, $page = 1, $totalpages = 1 ) { 366 368 global $themes_allowedtags; 367 369 368 370 $type = isset($_REQUEST['type']) ? stripslashes( $_REQUEST['type'] ) : ''; … … 419 421 if ( $col == 1 ) $class[] = 'left'; 420 422 if ( $row == $rows ) $class[] = 'bottom'; 421 423 if ( $col == 3 ) $class[] = 'right'; 422 $theme = $themes[$theme_index];424 $theme = ( isset($themes[$theme_index]) ) ? $themes[$theme_index] : ''; 423 425 ?> 424 426 <td class="<?php echo join(' ', $class); ?>"><?php 425 427 display_theme($theme); … … 476 478 $type = 'install'; 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 if ( is_object($update_themes) ) {480 foreach ( (array) $update_themes->response as $file => $theme ) {481 if ( is_object($update_themes) && isset($update_themes->response) ) { 482 foreach ( (array) $update_themes->response as $file => $theme ) { 481 483 if ( $theme->slug === $api->slug ) { 482 484 $type = 'update_available'; 483 485 $update_file = $file; … … 618 620 return; 619 621 } 620 622 621 $theme = isset($_REQUEST['theme']) ? stripslashes( $_REQUEST['theme'] ) : ''; 623 $theme = isset($_REQUEST['theme']) ? stripslashes( $_REQUEST['theme'] ) : ''; 624 $theme_name = isset($_REQUEST['theme_name']) ? stripslashes( $_REQUEST['theme_name'] ) : ''; 625 $download_url = isset($_REQUEST['download_url']) ? stripslashes( $_REQUEST['download_url'] ) : ''; 622 626 623 627 $url = 'theme-install.php?tab=install'; 624 $url = add_query_arg(array('theme' => $theme, 'theme_name' => stripslashes( $_REQUEST['theme_name'] ), 'download_url' => stripslashes( $_REQUEST['download_url'] )), $url);628 $url = add_query_arg(array('theme' => $theme, 'theme_name' => $theme_name, 'download_url' => $download_url ), $url); 625 629 626 630 $url = wp_nonce_url($url, 'install-theme_' . $theme); 627 631 if ( false === ($credentials = request_filesystem_credentials($url)) )