From 608b26589e3fa790198c3a77ad23c370c2ba8f79 Mon Sep 17 00:00:00 2001 From: nacin Date: Mon, 30 Apr 2012 00:44:47 +0000 Subject: [PATCH] Default to keyword searches for the plugin and theme installers in case no search type is posted back. fixes #19619. props georgestephanis, SergeyBiryukov for initial patches. git-svn-id: http://svn.automattic.com/wordpress/trunk@20639 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/class-wp-plugin-install-list-table.php | 2 +- wp-admin/includes/class-wp-theme-install-list-table.php | 2 +- wp-admin/includes/plugin-install.php | 2 +- wp-admin/includes/theme-install.php | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/wp-admin/includes/class-wp-plugin-install-list-table.php b/wp-admin/includes/class-wp-plugin-install-list-table.php index 417efc828..9335e96ba 100644 --- a/wp-admin/includes/class-wp-plugin-install-list-table.php +++ b/wp-admin/includes/class-wp-plugin-install-list-table.php @@ -47,7 +47,7 @@ class WP_Plugin_Install_List_Table extends WP_List_Table { switch ( $tab ) { case 'search': - $type = isset( $_REQUEST['type'] ) ? stripslashes( $_REQUEST['type'] ) : ''; + $type = isset( $_REQUEST['type'] ) ? stripslashes( $_REQUEST['type'] ) : 'term'; $term = isset( $_REQUEST['s'] ) ? stripslashes( $_REQUEST['s'] ) : ''; switch ( $type ) { diff --git a/wp-admin/includes/class-wp-theme-install-list-table.php b/wp-admin/includes/class-wp-theme-install-list-table.php index d79233b63..4231cd224 100644 --- a/wp-admin/includes/class-wp-theme-install-list-table.php +++ b/wp-admin/includes/class-wp-theme-install-list-table.php @@ -59,7 +59,7 @@ class WP_Theme_Install_List_Table extends WP_Themes_List_Table { switch ( $tab ) { case 'search': - $type = isset( $_REQUEST['type'] ) ? stripslashes( $_REQUEST['type'] ) : ''; + $type = isset( $_REQUEST['type'] ) ? stripslashes( $_REQUEST['type'] ) : 'term'; switch ( $type ) { case 'tag': $args['tag'] = array_map( 'sanitize_key', $search_terms ); diff --git a/wp-admin/includes/plugin-install.php b/wp-admin/includes/plugin-install.php index 9c7af81e4..442b35cde 100644 --- a/wp-admin/includes/plugin-install.php +++ b/wp-admin/includes/plugin-install.php @@ -116,7 +116,7 @@ add_action('install_plugins_dashboard', 'install_dashboard'); * @since 2.7.0 */ function install_search_form( $type_selector = true ) { - $type = isset($_REQUEST['type']) ? stripslashes( $_REQUEST['type'] ) : ''; + $type = isset($_REQUEST['type']) ? stripslashes( $_REQUEST['type'] ) : 'term'; $term = isset($_REQUEST['s']) ? stripslashes( $_REQUEST['s'] ) : ''; ?>
diff --git a/wp-admin/includes/theme-install.php b/wp-admin/includes/theme-install.php index 32cd60c3f..253f5840e 100644 --- a/wp-admin/includes/theme-install.php +++ b/wp-admin/includes/theme-install.php @@ -50,7 +50,7 @@ function install_themes_feature_list( ) { * @since 2.8.0 */ function install_theme_search_form( $type_selector = true ) { - $type = isset( $_REQUEST['type'] ) ? stripslashes( $_REQUEST['type'] ) : ''; + $type = isset( $_REQUEST['type'] ) ? stripslashes( $_REQUEST['type'] ) : 'term'; $term = isset( $_REQUEST['s'] ) ? stripslashes( $_REQUEST['s'] ) : ''; if ( ! $type_selector ) echo '

' . __( 'Search for themes by keyword.' ) . '

';