Changeset 38091
- Timestamp:
- 07/18/2016 01:59:17 PM (8 years ago)
- Location:
- trunk/src/wp-admin
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/ajax-actions.php
r38057 r38091 3782 3782 * @since 4.6.0 3783 3783 * 3784 * @global WP_List_Table $wp_list_table Current list table instance. 3785 * @global string $hook_suffix Current admin page. 3786 * @global string $s Search term. 3784 * @global string $s Search term. 3787 3785 */ 3788 3786 function wp_ajax_search_plugins() { 3789 3787 check_ajax_referer( 'updates' ); 3790 3788 3791 global $wp_list_table, $hook_suffix, $s; 3792 $hook_suffix = 'plugins.php'; 3789 $pagenow = isset( $_POST['pagenow'] ) ? sanitize_key( $_POST['pagenow'] ) : ''; 3790 if ( 'plugins-network' === $pagenow || 'plugins' === $pagenow ) { 3791 set_current_screen( $pagenow ); 3792 } 3793 3793 3794 3794 /** @var WP_Plugins_List_Table $wp_list_table */ 3795 $wp_list_table = _get_list_table( 'WP_Plugins_List_Table' ); 3796 $status = array(); 3795 $wp_list_table = _get_list_table( 'WP_Plugins_List_Table', array( 3796 'screen' => get_current_screen(), 3797 ) ); 3798 3799 $status = array(); 3797 3800 3798 3801 if ( ! $wp_list_table->ajax_user_can() ) { … … 3807 3810 ) ), network_admin_url( 'plugins.php', 'relative' ) ); 3808 3811 3809 $ s = sanitize_text_field( $_POST['s'] );3812 $GLOBALS['s'] = wp_unslash( $_POST['s'] ); 3810 3813 3811 3814 $wp_list_table->prepare_items(); … … 3823 3826 * 3824 3827 * @since 4.6.0 3825 *3826 * @global WP_List_Table $wp_list_table Current list table instance.3827 * @global string $hook_suffix Current admin page.3828 3828 */ 3829 3829 function wp_ajax_search_install_plugins() { 3830 3830 check_ajax_referer( 'updates' ); 3831 3831 3832 global $wp_list_table, $hook_suffix; 3833 $hook_suffix = 'plugin-install.php'; 3832 $pagenow = isset( $_POST['pagenow'] ) ? sanitize_key( $_POST['pagenow'] ) : ''; 3833 if ( 'plugin-install-network' === $pagenow || 'plugin-install' === $pagenow ) { 3834 set_current_screen( $pagenow ); 3835 } 3834 3836 3835 3837 /** @var WP_Plugin_Install_List_Table $wp_list_table */ 3836 $wp_list_table = _get_list_table( 'WP_Plugin_Install_List_Table' ); 3837 $status = array(); 3838 $wp_list_table = _get_list_table( 'WP_Plugin_Install_List_Table', array( 3839 'screen' => get_current_screen(), 3840 ) ); 3841 3842 $status = array(); 3838 3843 3839 3844 if ( ! $wp_list_table->ajax_user_can() ) { -
trunk/src/wp-admin/js/updates.js
r38075 r38091 2032 2032 data = _.extend( { 2033 2033 _ajax_nonce: wp.updates.ajaxNonce, 2034 s: $( '<p />' ).html( $( this ).val() ).text(),2034 s: $( this ).val(), 2035 2035 tab: 'search', 2036 type: $( '#typeselector' ).val() 2036 type: $( '#typeselector' ).val(), 2037 pagenow: pagenow 2037 2038 }, { type: 'term' } ); 2038 2039 … … 2044 2045 2045 2046 if ( history.pushState ) { 2046 history.pushState( null, '', location.href.split( '?' )[ 0 ] + '?' + $.param( _.omit( data, '_ajax_nonce') ) );2047 history.pushState( null, '', location.href.split( '?' )[ 0 ] + '?' + $.param( _.omit( data, [ '_ajax_nonce', 'pagenow' ] ) ) ); 2047 2048 } 2048 2049 … … 2072 2073 var data = { 2073 2074 _ajax_nonce: wp.updates.ajaxNonce, 2074 s: event.target.value 2075 s: event.target.value, 2076 pagenow: pagenow 2075 2077 }; 2076 2078 … … 2100 2102 2101 2103 // Can we just ditch this whole subtitle business? 2102 var $subTitle = $( '<span />' ).addClass( 'subtitle' ).html( wp.updates.l10n.searchResults.replace( '%s', data.s) ),2104 var $subTitle = $( '<span />' ).addClass( 'subtitle' ).html( wp.updates.l10n.searchResults.replace( '%s', _.escape( data.s ) ) ), 2103 2105 $oldSubTitle = $( '.wrap .subtitle' ); 2104 2106
Note: See TracChangeset
for help on using the changeset viewer.