We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4d3b0b9 commit 8383688Copy full SHA for 8383688
1 file changed
src/wp-admin/includes/ajax-actions.php
@@ -420,12 +420,14 @@ function wp_ajax_get_community_events() {
420
function wp_ajax_dashboard_widgets() {
421
require_once ABSPATH . 'wp-admin/includes/dashboard.php';
422
423
- $pagenow = $_GET['pagenow'];
+ $pagenow = isset( $_GET['pagenow'] ) ? sanitize_key( $_GET['pagenow'] ) : '';
424
+
425
if ( 'dashboard-user' === $pagenow || 'dashboard-network' === $pagenow || 'dashboard' === $pagenow ) {
426
set_current_screen( $pagenow );
427
}
428
- switch ( $_GET['widget'] ) {
429
+ $widget = isset( $_GET['widget'] ) ? sanitize_key( $_GET['widget'] ) : '';
430
+ switch ( $widget ) {
431
case 'dashboard_primary':
432
wp_dashboard_primary();
433
break;
0 commit comments