@@ -117,8 +117,8 @@ public function handle_listtable_oprations() {
117
117
global $ wpea_success_msg ;
118
118
if ( isset ( $ _GET ['wpea_action ' ] ) && $ _GET ['wpea_action ' ] == 'wpea_simport_delete ' && isset ($ _GET ['_wpnonce ' ]) && wp_verify_nonce ($ _GET ['_wpnonce ' ], 'wpea_delete_import_nonce ' ) ) {
119
119
$ import_id = $ _GET ['import_id ' ];
120
- $ page = isset ($ _GET ['page ' ] ) ? sanitize_text_field ( wp_unslash ( $ _GET ['page ' ] ) ) : 'import_events ' ;
121
- $ tab = isset ($ _GET ['tab ' ] ) ? sanitize_text_field ( wp_unslash ( $ _GET ['tab ' ] ) ) : 'scheduled ' ;
120
+ $ page = isset ($ _GET ['page ' ] ) ? esc_attr ( sanitize_text_field ( wp_unslash ( $ _GET ['page ' ] ) ) ) : 'import_events ' ;
121
+ $ tab = isset ($ _GET ['tab ' ] ) ? esc_attr ( sanitize_text_field ( wp_unslash ( $ _GET ['tab ' ] ) ) ) : 'scheduled ' ;
122
122
$ wp_redirect = admin_url ( 'admin.php?page= ' .$ page );
123
123
if ( $ import_id > 0 ) {
124
124
$ post_type = get_post_type ( $ import_id );
@@ -133,8 +133,8 @@ public function handle_listtable_oprations() {
133
133
134
134
if ( isset ( $ _GET ['wpea_action ' ] ) && $ _GET ['wpea_action ' ] == 'wpea_history_delete ' && isset ($ _GET ['_wpnonce ' ]) && wp_verify_nonce ($ _GET ['_wpnonce ' ], 'wpea_delete_history_nonce ' ) ) {
135
135
$ history_id = (int )sanitize_text_field ( wp_unslash ( $ _GET ['history_id ' ] ) );
136
- $ page = isset ($ _GET ['page ' ] ) ? sanitize_text_field ( wp_unslash ( $ _GET ['page ' ] ) ) : 'import_events ' ;
137
- $ tab = isset ($ _GET ['tab ' ] ) ? sanitize_text_field ( wp_unslash ( $ _GET ['tab ' ] ) ) : 'history ' ;
136
+ $ page = isset ($ _GET ['page ' ] ) ? esc_attr ( sanitize_text_field ( wp_unslash ( $ _GET ['page ' ] ) ) ) : 'import_events ' ;
137
+ $ tab = isset ($ _GET ['tab ' ] ) ? esc_attr ( sanitize_text_field ( wp_unslash ( $ _GET ['tab ' ] ) ) ) : 'history ' ;
138
138
$ wp_redirect = admin_url ( 'admin.php?page= ' .$ page );
139
139
if ( $ history_id > 0 ) {
140
140
wp_delete_post ( $ history_id , true );
@@ -146,8 +146,8 @@ public function handle_listtable_oprations() {
146
146
147
147
if ( isset ( $ _GET ['wpea_action ' ] ) && $ _GET ['wpea_action ' ] == 'wpea_run_import ' && isset ($ _GET ['_wpnonce ' ]) && wp_verify_nonce ($ _GET ['_wpnonce ' ], 'wpea_run_import_nonce ' ) ) {
148
148
$ import_id = (int )$ _GET ['import_id ' ];
149
- $ page = isset ($ _GET ['page ' ] ) ? sanitize_text_field ( wp_unslash ( $ _GET ['page ' ] ) ) : 'import_events ' ;
150
- $ tab = isset ($ _GET ['tab ' ] ) ? sanitize_text_field ( wp_unslash ( $ _GET ['tab ' ] ) ) : 'scheduled ' ;
149
+ $ page = isset ($ _GET ['page ' ] ) ? esc_attr ( sanitize_text_field ( wp_unslash ( $ _GET ['page ' ] ) ) ) : 'import_events ' ;
150
+ $ tab = isset ($ _GET ['tab ' ] ) ? esc_attr ( sanitize_text_field ( wp_unslash ( $ _GET ['tab ' ] ) ) ) : 'scheduled ' ;
151
151
$ wp_redirect = admin_url ( 'admin.php?page= ' .$ page );
152
152
if ( $ import_id > 0 ) {
153
153
do_action ( 'xt_run_scheduled_import ' , $ import_id );
@@ -160,7 +160,7 @@ public function handle_listtable_oprations() {
160
160
$ is_bulk_delete = ( ( isset ( $ _GET ['action ' ] ) && sanitize_text_field ( wp_unslash ( $ _GET ['action ' ] ) ) == 'delete ' ) || ( isset ( $ _GET ['action2 ' ] ) && sanitize_text_field ( wp_unslash ( $ _GET ['action2 ' ] ) ) == 'delete ' ) );
161
161
162
162
if ( $ is_bulk_delete && isset ($ _GET ['_wpnonce ' ]) && wp_verify_nonce ($ _GET ['_wpnonce ' ], 'bulk-xt_scheduled_imports ' ) ) {
163
- $ tab = isset ($ _GET ['tab ' ] ) ? sanitize_text_field ( wp_unslash ( $ _GET ['tab ' ] ) ) : 'scheduled ' ;
163
+ $ tab = isset ($ _GET ['tab ' ] ) ? esc_attr ( sanitize_text_field ( wp_unslash ( $ _GET ['tab ' ] ) ) ) : 'scheduled ' ;
164
164
$ wp_redirect = get_site_url () . urldecode ( sanitize_text_field ( $ _REQUEST ['_wp_http_referer ' ] ) );
165
165
$ delete_ids = array_map ( 'sanitize_text_field ' , $ _REQUEST ['xt_scheduled_import ' ] );
166
166
if ( !empty ( $ delete_ids ) ){
@@ -178,7 +178,7 @@ public function handle_listtable_oprations() {
178
178
}
179
179
180
180
if ( $ is_bulk_delete && isset ($ _GET ['_wpnonce ' ]) && wp_verify_nonce ($ _GET ['_wpnonce ' ], 'bulk-import_histories ' ) ) {
181
- $ tab = isset ($ _GET ['tab ' ] ) ? sanitize_text_field ( wp_unslash ( $ _GET ['tab ' ] ) ) : 'history ' ;
181
+ $ tab = isset ( $ _GET ['tab ' ] ) ? esc_attr ( sanitize_text_field ( wp_unslash ( $ _GET ['tab ' ] ) ) ) : 'history ' ;
182
182
$ wp_redirect = get_site_url () . urldecode ( sanitize_text_field ( $ _REQUEST ['_wp_http_referer ' ] ) ); $ delete_ids = array_map ( 'sanitize_text_field ' , $ _REQUEST ['import_history ' ] );
183
183
if ( !empty ( $ delete_ids ) ){
184
184
foreach ($ delete_ids as $ delete_id ) {
@@ -192,8 +192,8 @@ public function handle_listtable_oprations() {
192
192
193
193
// Delete All History Data
194
194
if ( isset ( $ _GET ['wpea_action ' ] ) && $ _GET ['wpea_action ' ] === 'wpea_all_history_delete ' && isset ( $ _GET ['_wpnonce ' ] ) && wp_verify_nonce ( $ _GET ['_wpnonce ' ], 'wpea_delete_all_history_nonce ' ) ) {
195
- $ page = isset ( $ _GET ['page ' ] ) ? $ _GET ['page ' ] : 'import_events ' ;
196
- $ tab = isset ( $ _GET ['tab ' ] ) ? $ _GET ['tab ' ] : 'history ' ;
195
+ $ page = isset ( $ _GET ['page ' ] ) ? esc_attr ( sanitize_text_field ( wp_unslash ( $ _GET ['page ' ] ) ) ) : 'import_events ' ;
196
+ $ tab = isset ( $ _GET ['tab ' ] ) ? esc_attr ( sanitize_text_field ( wp_unslash ( $ _GET ['tab ' ] ) ) ) : 'history ' ;
197
197
$ wp_redirect = admin_url ( 'admin.php?page= ' . $ page );
198
198
$ delete_ids = get_posts ( array ( 'numberposts ' => -1 ,'fields ' => 'ids ' , 'post_type ' => 'wpea_import_history ' ) );
199
199
0 commit comments