-
diff --git src/wp-admin/comment.php src/wp-admin/comment.php
index c2eca11ec3..aabd361cb7 100644
|
|
$submenu_file = 'edit-comments.php'; |
16 | 16 | * @global string $action |
17 | 17 | */ |
18 | 18 | global $action; |
19 | | wp_reset_vars( array('action') ); |
| 19 | |
| 20 | if ( isset( $_REQUEST['action'] ) ) { |
| 21 | $action = sanitize_text_field( $_REQUEST['action'] ); |
| 22 | } |
20 | 23 | |
21 | 24 | if ( isset( $_POST['deletecomment'] ) ) |
22 | 25 | $action = 'deletecomment'; |
-
diff --git src/wp-admin/customize.php src/wp-admin/customize.php
index f1bf8aa9a1..cfb2b01195 100644
|
|
if ( $wp_customize->changeset_post_id() ) { |
44 | 44 | } |
45 | 45 | } |
46 | 46 | |
| 47 | if ( isset( $_REQUEST['url'] ) ) { |
| 48 | $url = sanitize_text_field( $_REQUEST['url'] ); |
| 49 | } |
| 50 | |
| 51 | if ( isset( $_REQUEST['return'] ) ) { |
| 52 | $return = sanitize_text_field( $_REQUEST['return'] ); |
| 53 | } |
| 54 | |
| 55 | if ( isset( $_REQUEST['autofocus'] ) ) { |
| 56 | $autofocus = sanitize_text_field( $_REQUEST['autofocus'] ); |
| 57 | } |
47 | 58 | |
48 | | wp_reset_vars( array( 'url', 'return', 'autofocus' ) ); |
49 | 59 | if ( ! empty( $url ) ) { |
50 | 60 | $wp_customize->set_preview_url( wp_unslash( $url ) ); |
51 | 61 | } |
-
diff --git src/wp-admin/edit-tag-form.php src/wp-admin/edit-tag-form.php
index e3fb222bc9..0ad8e64cbb 100644
|
|
if ( 'category' == $taxonomy ) { |
44 | 44 | do_action( 'edit_tag_form_pre', $tag ); |
45 | 45 | } |
46 | 46 | |
47 | | /** |
48 | | * Use with caution, see https://codex.wordpress.org/Function_Reference/wp_reset_vars |
49 | | */ |
50 | | wp_reset_vars( array( 'wp_http_referer' ) ); |
| 47 | if ( isset( $_REQUEST['wp_http_referer'] ) ) { |
| 48 | $wp_http_referer = sanitize_text_field( $_REQUEST['wp_http_referer'] ); |
| 49 | } |
51 | 50 | |
52 | 51 | $wp_http_referer = remove_query_arg( array( 'action', 'message', 'tag_ID' ), $wp_http_referer ); |
53 | 52 | |
-
diff --git src/wp-admin/includes/class-wp-links-list-table.php src/wp-admin/includes/class-wp-links-list-table.php
index 0c241215a2..c10494d4d9 100644
|
|
class WP_Links_List_Table extends WP_List_Table { |
51 | 51 | public function prepare_items() { |
52 | 52 | global $cat_id, $s, $orderby, $order; |
53 | 53 | |
54 | | wp_reset_vars( array( 'action', 'cat_id', 'link_id', 'orderby', 'order', 's' ) ); |
| 54 | if ( isset( $_REQUEST['action'] ) ) { |
| 55 | $action = sanitize_text_field( $_REQUEST['action'] ); |
| 56 | } |
| 57 | |
| 58 | if ( isset( $_REQUEST['cat_id'] ) ) { |
| 59 | $cat_id = sanitize_text_field( $_REQUEST['cat_id'] ); |
| 60 | } |
| 61 | |
| 62 | if ( isset( $_REQUEST['link_id'] ) ) { |
| 63 | $link_id = sanitize_text_field( $_REQUEST['link_id'] ); |
| 64 | } |
| 65 | |
| 66 | if ( isset( $_REQUEST['orderby'] ) ) { |
| 67 | $orderby = sanitize_text_field( $_REQUEST['orderby'] ); |
| 68 | } |
| 69 | |
| 70 | if ( isset( $_REQUEST['order'] ) ) { |
| 71 | $order = sanitize_text_field( $_REQUEST['order'] ); |
| 72 | } |
| 73 | |
| 74 | if ( isset( $_REQUEST['s'] ) ) { |
| 75 | $s = sanitize_text_field( $_REQUEST['s'] ); |
| 76 | } |
55 | 77 | |
56 | 78 | $args = array( 'hide_invisible' => 0, 'hide_empty' => 0 ); |
57 | 79 | |
-
diff --git src/wp-admin/includes/class-wp-ms-themes-list-table.php src/wp-admin/includes/class-wp-ms-themes-list-table.php
index fc618f0993..977adca34c 100644
|
|
class WP_MS_Themes_List_Table extends WP_List_Table { |
86 | 86 | public function prepare_items() { |
87 | 87 | global $status, $totals, $page, $orderby, $order, $s; |
88 | 88 | |
89 | | wp_reset_vars( array( 'orderby', 'order', 's' ) ); |
| 89 | if ( isset( $_REQUEST['orderby'] ) ) { |
| 90 | $orderby = sanitize_text_field( $_REQUEST['orderby'] ); |
| 91 | } |
| 92 | |
| 93 | if ( isset( $_REQUEST['order'] ) ) { |
| 94 | $order = sanitize_text_field( $_REQUEST['order'] ); |
| 95 | } |
| 96 | |
| 97 | if ( isset( $_REQUEST['s'] ) ) { |
| 98 | $s = sanitize_text_field( $_REQUEST['s'] ); |
| 99 | } |
90 | 100 | |
91 | 101 | $themes = array( |
92 | 102 | /** |
-
diff --git src/wp-admin/includes/class-wp-plugin-install-list-table.php src/wp-admin/includes/class-wp-plugin-install-list-table.php
index 99dd1c74cf..d7dd65f7ac 100644
|
|
class WP_Plugin_Install_List_Table extends WP_List_Table { |
74 | 74 | |
75 | 75 | global $tabs, $tab, $paged, $type, $term; |
76 | 76 | |
77 | | wp_reset_vars( array( 'tab' ) ); |
| 77 | if ( isset( $_REQUEST['tab'] ) ) { |
| 78 | $tab = sanitize_text_field( $_REQUEST['tab'] ); |
| 79 | } |
78 | 80 | |
79 | 81 | $paged = $this->get_pagenum(); |
80 | 82 | |
-
diff --git src/wp-admin/includes/class-wp-plugins-list-table.php src/wp-admin/includes/class-wp-plugins-list-table.php
index 41b36d45d7..d4e6e198c3 100644
|
|
class WP_Plugins_List_Table extends WP_List_Table { |
74 | 74 | public function prepare_items() { |
75 | 75 | global $status, $plugins, $totals, $page, $orderby, $order, $s; |
76 | 76 | |
77 | | wp_reset_vars( array( 'orderby', 'order' ) ); |
| 77 | if ( isset( $_REQUEST['orderby'] ) ) { |
| 78 | $orderby = sanitize_text_field( $_REQUEST['orderby'] ); |
| 79 | } |
| 80 | |
| 81 | if ( isset( $_REQUEST['order'] ) ) { |
| 82 | $order = sanitize_text_field( $_REQUEST['order'] ); |
| 83 | } |
78 | 84 | |
79 | 85 | /** |
80 | 86 | * Filters the full array of plugins to list in the Plugins list table. |
-
diff --git src/wp-admin/includes/class-wp-theme-install-list-table.php src/wp-admin/includes/class-wp-theme-install-list-table.php
index c1cd88d5cb..1a630e38bf 100644
|
|
class WP_Theme_Install_List_Table extends WP_Themes_List_Table { |
39 | 39 | include( ABSPATH . 'wp-admin/includes/theme-install.php' ); |
40 | 40 | |
41 | 41 | global $tabs, $tab, $paged, $type, $theme_field_defaults; |
42 | | wp_reset_vars( array( 'tab' ) ); |
| 42 | |
| 43 | if ( isset( $_REQUEST['tab'] ) ) { |
| 44 | $tab = sanitize_text_field( $_REQUEST['tab'] ); |
| 45 | } |
43 | 46 | |
44 | 47 | $search_terms = array(); |
45 | 48 | $search_string = ''; |
-
diff --git src/wp-admin/includes/misc.php src/wp-admin/includes/misc.php
index 679b9ac5d6..a046941e49 100644
|
|
function update_home_siteurl( $old_value, $value ) { |
299 | 299 | * @since 2.0.0 |
300 | 300 | * |
301 | 301 | * @param array $vars An array of globals to reset. |
| 302 | * |
| 303 | * @deprecated in WordPress 4.9 and will be removed before WordPress 5.0. |
| 304 | * Use sanitize_text_field(). |
302 | 305 | */ |
303 | 306 | function wp_reset_vars( $vars ) { |
304 | 307 | foreach ( $vars as $var ) { |
-
diff --git src/wp-admin/link-add.php src/wp-admin/link-add.php
index 423c6680e5..2a021421ef 100644
|
|
if ( ! current_user_can('manage_links') ) |
15 | 15 | $title = __('Add New Link'); |
16 | 16 | $parent_file = 'link-manager.php'; |
17 | 17 | |
18 | | wp_reset_vars( array('action', 'cat_id', 'link_id' ) ); |
| 18 | if ( isset( $_REQUEST['action'] ) ) { |
| 19 | $action = sanitize_text_field( $_REQUEST['action'] ); |
| 20 | } |
| 21 | |
| 22 | if ( isset( $_REQUEST['cat_id'] ) ) { |
| 23 | $cat_id = sanitize_text_field( $_REQUEST['cat_id'] ); |
| 24 | } |
| 25 | |
| 26 | if ( isset( $_REQUEST['link_id'] ) ) { |
| 27 | $link_id = sanitize_text_field( $_REQUEST['link_id'] ); |
| 28 | } |
19 | 29 | |
20 | 30 | wp_enqueue_script('link'); |
21 | 31 | wp_enqueue_script('xfn'); |
-
diff --git src/wp-admin/link.php src/wp-admin/link.php
index bcfe578fb0..6547ae63da 100644
|
|
|
12 | 12 | /** Load WordPress Administration Bootstrap */ |
13 | 13 | require_once( dirname( __FILE__ ) . '/admin.php' ); |
14 | 14 | |
15 | | wp_reset_vars( array( 'action', 'cat_id', 'link_id' ) ); |
| 15 | if ( isset( $_REQUEST['action'] ) ) { |
| 16 | $action = sanitize_text_field( $_REQUEST['action'] ); |
| 17 | } |
| 18 | |
| 19 | if ( isset( $_REQUEST['cat_id'] ) ) { |
| 20 | $cat_id = sanitize_text_field( $_REQUEST['cat_id'] ); |
| 21 | } |
| 22 | |
| 23 | if ( isset( $_REQUEST['link_id'] ) ) { |
| 24 | $link_id = sanitize_text_field( $_REQUEST['link_id'] ); |
| 25 | } |
16 | 26 | |
17 | 27 | if ( ! current_user_can('manage_links') ) |
18 | 28 | wp_link_manager_disabled_message(); |
-
diff --git src/wp-admin/media.php src/wp-admin/media.php
index be3cecad98..2515fbe738 100644
|
|
require_once( dirname( __FILE__ ) . '/admin.php' ); |
12 | 12 | $parent_file = 'upload.php'; |
13 | 13 | $submenu_file = 'upload.php'; |
14 | 14 | |
15 | | wp_reset_vars(array('action')); |
| 15 | if ( isset( $_REQUEST['action'] ) ) { |
| 16 | $action = sanitize_text_field( $_REQUEST['action'] ); |
| 17 | } |
16 | 18 | |
17 | 19 | switch ( $action ) { |
18 | 20 | case 'editattachment' : |
-
diff --git src/wp-admin/options-head.php src/wp-admin/options-head.php
index bee3ae7e67..d0d5b1ef5b 100644
|
|
|
8 | 8 | * @subpackage Administration |
9 | 9 | */ |
10 | 10 | |
11 | | wp_reset_vars( array( 'action' ) ); |
| 11 | if ( isset( $_REQUEST['action'] ) ) { |
| 12 | $action = sanitize_text_field( $_REQUEST['action'] ); |
| 13 | } |
12 | 14 | |
13 | 15 | if ( isset( $_GET['updated'] ) && isset( $_GET['page'] ) ) { |
14 | 16 | // For back-compat with plugins that don't use the Settings API and just set updated=1 in the redirect. |
-
diff --git src/wp-admin/options.php src/wp-admin/options.php
index d2e1c0374f..f030e8a7d5 100644
|
|
$title = __('Settings'); |
22 | 22 | $this_file = 'options.php'; |
23 | 23 | $parent_file = 'options-general.php'; |
24 | 24 | |
25 | | wp_reset_vars(array('action', 'option_page')); |
| 25 | if ( isset( $_REQUEST['action'] ) ) { |
| 26 | $action = sanitize_text_field( $_REQUEST['action'] ); |
| 27 | } |
| 28 | |
| 29 | if ( isset( $_REQUEST['option_page'] ) ) { |
| 30 | $option_page = sanitize_text_field( $_REQUEST['option_page'] ); |
| 31 | } |
26 | 32 | |
27 | 33 | $capability = 'manage_options'; |
28 | 34 | |
-
diff --git src/wp-admin/post.php src/wp-admin/post.php
index cf2bee5790..dd4e8b9c4d 100644
|
|
require_once( dirname( __FILE__ ) . '/admin.php' ); |
14 | 14 | $parent_file = 'edit.php'; |
15 | 15 | $submenu_file = 'edit.php'; |
16 | 16 | |
17 | | wp_reset_vars( array( 'action' ) ); |
| 17 | if ( isset( $_REQUEST['action'] ) ) { |
| 18 | $action = sanitize_text_field( $_REQUEST['action'] ); |
| 19 | } |
18 | 20 | |
19 | 21 | if ( isset( $_GET['post'] ) ) |
20 | 22 | $post_id = $post_ID = (int) $_GET['post']; |
-
diff --git src/wp-admin/revision.php src/wp-admin/revision.php
index c86f78a451..3634eba234 100644
|
|
require_once( dirname( __FILE__ ) . '/admin.php' ); |
20 | 20 | |
21 | 21 | require ABSPATH . 'wp-admin/includes/revision.php'; |
22 | 22 | |
23 | | wp_reset_vars( array( 'revision', 'action', 'from', 'to' ) ); |
| 23 | if ( isset( $_REQUEST['revision'] ) ) { |
| 24 | $revision = sanitize_text_field( $_REQUEST['revision'] ); |
| 25 | } |
| 26 | |
| 27 | if ( isset( $_REQUEST['action'] ) ) { |
| 28 | $action = sanitize_text_field( $_REQUEST['action'] ); |
| 29 | } |
| 30 | |
| 31 | if ( isset( $_REQUEST['from'] ) ) { |
| 32 | $from = sanitize_text_field( $_REQUEST['from'] ); |
| 33 | } |
| 34 | |
| 35 | if ( isset( $_REQUEST['to'] ) ) { |
| 36 | $to = sanitize_text_field( $_REQUEST['to'] ); |
| 37 | } |
24 | 38 | |
25 | 39 | $revision_id = absint( $revision ); |
26 | 40 | |
-
diff --git src/wp-admin/theme-editor.php src/wp-admin/theme-editor.php
index 03b91944ea..919befa93e 100644
|
|
get_current_screen()->set_help_sidebar( |
43 | 43 | '<p>' . __('<a href="https://wordpress.org/support/">Support Forums</a>') . '</p>' |
44 | 44 | ); |
45 | 45 | |
46 | | wp_reset_vars( array( 'action', 'error', 'file', 'theme' ) ); |
| 46 | if ( isset( $_REQUEST['action'] ) ) { |
| 47 | $action = sanitize_text_field( $_REQUEST['action'] ); |
| 48 | } |
| 49 | |
| 50 | if ( isset( $_REQUEST['error'] ) ) { |
| 51 | $error = sanitize_text_field( $_REQUEST['error'] ); |
| 52 | } |
| 53 | |
| 54 | if ( isset( $_REQUEST['file'] ) ) { |
| 55 | $file = sanitize_text_field( $_REQUEST['file'] ); |
| 56 | } |
| 57 | |
| 58 | if ( isset( $_REQUEST['theme'] ) ) { |
| 59 | $theme = sanitize_text_field( $_REQUEST['theme'] ); |
| 60 | } |
47 | 61 | |
48 | 62 | if ( $theme ) { |
49 | 63 | $stylesheet = $theme; |
-
diff --git src/wp-admin/theme-install.php src/wp-admin/theme-install.php
index dd9ff500d1..50ed4424b9 100644
|
|
|
10 | 10 | require_once( dirname( __FILE__ ) . '/admin.php' ); |
11 | 11 | require( ABSPATH . 'wp-admin/includes/theme-install.php' ); |
12 | 12 | |
13 | | wp_reset_vars( array( 'tab' ) ); |
| 13 | if ( isset( $_REQUEST['tab'] ) ) { |
| 14 | $tab = sanitize_text_field( $_REQUEST['tab'] ); |
| 15 | } |
14 | 16 | |
15 | 17 | if ( ! current_user_can('install_themes') ) |
16 | 18 | wp_die( __( 'Sorry, you are not allowed to install themes on this site.' ) ); |
-
diff --git src/wp-admin/themes.php src/wp-admin/themes.php
index b73cd166d5..6dcf875029 100644
|
|
if ( current_user_can( 'switch_themes' ) ) { |
124 | 124 | } else { |
125 | 125 | $themes = wp_prepare_themes_for_js( array( wp_get_theme() ) ); |
126 | 126 | } |
127 | | wp_reset_vars( array( 'theme', 'search' ) ); |
| 127 | |
| 128 | if ( isset( $_REQUEST['theme'] ) ) { |
| 129 | $theme = sanitize_text_field( $_REQUEST['theme'] ); |
| 130 | } |
| 131 | |
| 132 | if ( isset( $_REQUEST['search'] ) ) { |
| 133 | $search = sanitize_text_field( $_REQUEST['search'] ); |
| 134 | } |
128 | 135 | |
129 | 136 | wp_localize_script( 'theme', '_wpThemeSettings', array( |
130 | 137 | 'themes' => $themes, |
-
diff --git src/wp-admin/user-edit.php src/wp-admin/user-edit.php
index e034163da4..e7c8c77c6b 100644
|
|
|
9 | 9 | /** WordPress Administration Bootstrap */ |
10 | 10 | require_once( dirname( __FILE__ ) . '/admin.php' ); |
11 | 11 | |
12 | | wp_reset_vars( array( 'action', 'user_id', 'wp_http_referer' ) ); |
| 12 | if ( isset( $_REQUEST['action'] ) ) { |
| 13 | $action = sanitize_text_field( $_REQUEST['action'] ); |
| 14 | } |
| 15 | |
| 16 | if ( isset( $_REQUEST['user_id'] ) ) { |
| 17 | $user_id = sanitize_text_field( $_REQUEST['user_id'] ); |
| 18 | } |
| 19 | |
| 20 | if ( isset( $_REQUEST['wp_http_referer'] ) ) { |
| 21 | $wp_http_referer = sanitize_text_field( $_REQUEST['wp_http_referer'] ); |
| 22 | } |
13 | 23 | |
14 | 24 | $user_id = (int) $user_id; |
15 | 25 | $current_user = wp_get_current_user(); |