|
18 | 18 |
|
19 | 19 | $action = $wp_list_table->current_action(); |
20 | 20 |
|
21 | | -$plugin = isset( $_REQUEST['plugin'] ) ? wp_unslash( $_REQUEST['plugin'] ) : ''; |
22 | | -$search_term = isset( $_REQUEST['s'] ) ? urlencode( wp_unslash( $_REQUEST['s'] ) ) : ''; |
| 21 | +$plugin = isset( $_REQUEST['plugin'] ) ? wp_unslash( $_REQUEST['plugin'] ) : ''; |
| 22 | +$s = isset( $_REQUEST['s'] ) ? urlencode( wp_unslash( $_REQUEST['s'] ) ) : ''; |
23 | 23 |
|
24 | 24 | // Clean up request URI from temporary args for screen options/paging uri's to work as expected. |
25 | 25 | $query_args_to_remove = array( |
|
51 | 51 | } |
52 | 52 |
|
53 | 53 | if ( is_multisite() && ! is_network_admin() && is_network_only_plugin( $plugin ) ) { |
54 | | - wp_redirect( self_admin_url( "plugins.php?plugin_status=$status&paged=$page&s=$search_term" ) ); |
| 54 | + wp_redirect( self_admin_url( "plugins.php?plugin_status=$status&paged=$page&s=$s" ) ); |
55 | 55 | exit; |
56 | 56 | } |
57 | 57 |
|
|
60 | 60 | $result = activate_plugin( $plugin, self_admin_url( 'plugins.php?error=true&plugin=' . urlencode( $plugin ) ), is_network_admin() ); |
61 | 61 | if ( is_wp_error( $result ) ) { |
62 | 62 | if ( 'unexpected_output' === $result->get_error_code() ) { |
63 | | - $redirect = self_admin_url( 'plugins.php?error=true&charsout=' . strlen( $result->get_error_data() ) . '&plugin=' . urlencode( $plugin ) . "&plugin_status=$status&paged=$page&s=$search_term" ); |
| 63 | + $redirect = self_admin_url( 'plugins.php?error=true&charsout=' . strlen( $result->get_error_data() ) . '&plugin=' . urlencode( $plugin ) . "&plugin_status=$status&paged=$page&s=$s" ); |
64 | 64 | wp_redirect( add_query_arg( '_error_nonce', wp_create_nonce( 'plugin-activation-error_' . $plugin ), $redirect ) ); |
65 | 65 | exit; |
66 | 66 | } else { |
|
85 | 85 | wp_redirect( self_admin_url( 'press-this.php' ) ); |
86 | 86 | } else { |
87 | 87 | // Overrides the ?error=true one above. |
88 | | - wp_redirect( self_admin_url( "plugins.php?activate=true&plugin_status=$status&paged=$page&s=$search_term" ) ); |
| 88 | + wp_redirect( self_admin_url( "plugins.php?activate=true&plugin_status=$status&paged=$page&s=$s" ) ); |
89 | 89 | } |
90 | 90 | exit; |
91 | 91 |
|
|
119 | 119 | } |
120 | 120 |
|
121 | 121 | if ( empty( $plugins ) ) { |
122 | | - wp_redirect( self_admin_url( "plugins.php?plugin_status=$status&paged=$page&s=$search_term" ) ); |
| 122 | + wp_redirect( self_admin_url( "plugins.php?plugin_status=$status&paged=$page&s=$s" ) ); |
123 | 123 | exit; |
124 | 124 | } |
125 | 125 |
|
|
141 | 141 | update_site_option( 'recently_activated', $recent ); |
142 | 142 | } |
143 | 143 |
|
144 | | - wp_redirect( self_admin_url( "plugins.php?activate-multi=true&plugin_status=$status&paged=$page&s=$search_term" ) ); |
| 144 | + wp_redirect( self_admin_url( "plugins.php?activate-multi=true&plugin_status=$status&paged=$page&s=$s" ) ); |
145 | 145 | exit; |
146 | 146 |
|
147 | 147 | case 'update-selected': |
|
204 | 204 | check_admin_referer( 'deactivate-plugin_' . $plugin ); |
205 | 205 |
|
206 | 206 | if ( ! is_network_admin() && is_plugin_active_for_network( $plugin ) ) { |
207 | | - wp_redirect( self_admin_url( "plugins.php?plugin_status=$status&paged=$page&s=$search_term" ) ); |
| 207 | + wp_redirect( self_admin_url( "plugins.php?plugin_status=$status&paged=$page&s=$s" ) ); |
208 | 208 | exit; |
209 | 209 | } |
210 | 210 |
|
|
217 | 217 | } |
218 | 218 |
|
219 | 219 | if ( headers_sent() ) { |
220 | | - echo "<meta http-equiv='refresh' content='" . esc_attr( "0;url=plugins.php?deactivate=true&plugin_status=$status&paged=$page&s=$search_term" ) . "' />"; |
| 220 | + echo "<meta http-equiv='refresh' content='" . esc_attr( "0;url=plugins.php?deactivate=true&plugin_status=$status&paged=$page&s=$s" ) . "' />"; |
221 | 221 | } else { |
222 | | - wp_redirect( self_admin_url( "plugins.php?deactivate=true&plugin_status=$status&paged=$page&s=$search_term" ) ); |
| 222 | + wp_redirect( self_admin_url( "plugins.php?deactivate=true&plugin_status=$status&paged=$page&s=$s" ) ); |
223 | 223 | } |
224 | 224 | exit; |
225 | 225 |
|
|
246 | 246 | } |
247 | 247 | } |
248 | 248 | if ( empty( $plugins ) ) { |
249 | | - wp_redirect( self_admin_url( "plugins.php?plugin_status=$status&paged=$page&s=$search_term" ) ); |
| 249 | + wp_redirect( self_admin_url( "plugins.php?plugin_status=$status&paged=$page&s=$s" ) ); |
250 | 250 | exit; |
251 | 251 | } |
252 | 252 |
|
|
263 | 263 | update_site_option( 'recently_activated', $deactivated + (array) get_site_option( 'recently_activated' ) ); |
264 | 264 | } |
265 | 265 |
|
266 | | - wp_redirect( self_admin_url( "plugins.php?deactivate-multi=true&plugin_status=$status&paged=$page&s=$search_term" ) ); |
| 266 | + wp_redirect( self_admin_url( "plugins.php?deactivate-multi=true&plugin_status=$status&paged=$page&s=$s" ) ); |
267 | 267 | exit; |
268 | 268 |
|
269 | 269 | case 'delete-selected': |
|
276 | 276 | // $_POST = from the plugin form; $_GET = from the FTP details screen. |
277 | 277 | $plugins = isset( $_REQUEST['checked'] ) ? (array) wp_unslash( $_REQUEST['checked'] ) : array(); |
278 | 278 | if ( empty( $plugins ) ) { |
279 | | - wp_redirect( self_admin_url( "plugins.php?plugin_status=$status&paged=$page&s=$search_term" ) ); |
| 279 | + wp_redirect( self_admin_url( "plugins.php?plugin_status=$status&paged=$page&s=$s" ) ); |
280 | 280 | exit; |
281 | 281 | } |
282 | 282 |
|
283 | 283 | $plugins = array_filter( $plugins, 'is_plugin_inactive' ); // Do not allow to delete activated plugins. |
284 | 284 | if ( empty( $plugins ) ) { |
285 | | - wp_redirect( self_admin_url( "plugins.php?error=true&main=true&plugin_status=$status&paged=$page&s=$search_term" ) ); |
| 285 | + wp_redirect( self_admin_url( "plugins.php?error=true&main=true&plugin_status=$status&paged=$page&s=$s" ) ); |
286 | 286 | exit; |
287 | 287 | } |
288 | 288 |
|
289 | 289 | // Bail on all if any paths are invalid. |
290 | 290 | // validate_file() returns truthy for invalid files. |
291 | 291 | $invalid_plugin_files = array_filter( $plugins, 'validate_file' ); |
292 | 292 | if ( $invalid_plugin_files ) { |
293 | | - wp_redirect( self_admin_url( "plugins.php?plugin_status=$status&paged=$page&s=$search_term" ) ); |
| 293 | + wp_redirect( self_admin_url( "plugins.php?plugin_status=$status&paged=$page&s=$s" ) ); |
294 | 294 | exit; |
295 | 295 | } |
296 | 296 |
|
|
432 | 432 | // Store the result in an option rather than a URL param due to object type & length. |
433 | 433 | // Cannot use transient/cache, as that could get flushed if any plugin flushes data on uninstall/delete. |
434 | 434 | update_option( 'plugins_delete_result_' . $user_ID, $delete_result, false ); |
435 | | - wp_redirect( self_admin_url( "plugins.php?deleted=$plugins_to_delete&plugin_status=$status&paged=$page&s=$search_term" ) ); |
| 435 | + wp_redirect( self_admin_url( "plugins.php?deleted=$plugins_to_delete&plugin_status=$status&paged=$page&s=$s" ) ); |
436 | 436 | exit; |
437 | 437 | case 'clear-recent-list': |
438 | 438 | if ( ! is_network_admin() ) { |
|
453 | 453 |
|
454 | 454 | check_admin_referer( 'resume-plugin_' . $plugin ); |
455 | 455 |
|
456 | | - $result = resume_plugin( $plugin, self_admin_url( "plugins.php?error=resuming&plugin_status=$status&paged=$page&s=$search_term" ) ); |
| 456 | + $result = resume_plugin( $plugin, self_admin_url( "plugins.php?error=resuming&plugin_status=$status&paged=$page&s=$s" ) ); |
457 | 457 |
|
458 | 458 | if ( is_wp_error( $result ) ) { |
459 | 459 | wp_die( $result ); |
460 | 460 | } |
461 | 461 |
|
462 | | - wp_redirect( self_admin_url( "plugins.php?resume=true&plugin_status=$status&paged=$page&s=$search_term" ) ); |
| 462 | + wp_redirect( self_admin_url( "plugins.php?resume=true&plugin_status=$status&paged=$page&s=$s" ) ); |
463 | 463 | exit; |
464 | 464 | case 'enable-auto-update': |
465 | 465 | case 'disable-auto-update': |
|
473 | 473 | wp_die( __( 'Please connect to your network admin to manage plugins automatic updates.' ) ); |
474 | 474 | } |
475 | 475 |
|
476 | | - $redirect = self_admin_url( "plugins.php?plugin_status={$status}&paged={$page}&s={$search_term}" ); |
| 476 | + $redirect = self_admin_url( "plugins.php?plugin_status={$status}&paged={$page}&s={$s}" ); |
477 | 477 |
|
478 | 478 | if ( 'enable-auto-update' === $action || 'disable-auto-update' === $action ) { |
479 | 479 | if ( empty( $plugin ) ) { |
|
771 | 771 | <?php |
772 | 772 | } |
773 | 773 |
|
774 | | -if ( strlen( $search_term ) ) { |
| 774 | +if ( strlen( $s ) ) { |
775 | 775 | echo '<span class="subtitle">'; |
776 | 776 | printf( |
777 | 777 | /* translators: %s: Search query. */ |
778 | 778 | __( 'Search results for: %s' ), |
779 | | - '<strong>' . esc_html( urldecode( $search_term ) ) . '</strong>' |
| 779 | + '<strong>' . esc_html( urldecode( $s ) ) . '</strong>' |
780 | 780 | ); |
781 | 781 | echo '</span>'; |
782 | 782 | } |
|
0 commit comments