File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -22,13 +22,17 @@ function wp_super_cache_blogs_field( $name, $blog_id ) {
2222
2323 $ blog_id = (int ) $ blog_id ;
2424
25- if ( isset ( $ _GET ['id ' ] ) && isset ( $ _GET ['action ' ] ) && isset ( $ _GET ['_wpnonce ' ] ) // phpcs:ignore WordPress.Security.NonceVerification.Recommended
26- && filter_input ( INPUT_GET , 'id ' , FILTER_VALIDATE_INT ) === $ blog_id
27- && wp_verify_nonce ( sanitize_text_field ( wp_unslash ( $ _GET ['_wpnonce ' ] ) ), 'wp-cache ' . $ blog_id ) // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
25+ $ get_id = filter_input ( INPUT_GET , 'id ' , FILTER_VALIDATE_INT );
26+ $ get_action = filter_input ( INPUT_GET , 'action ' , FILTER_SANITIZE_FULL_SPECIAL_CHARS );
27+ $ get_nonce = filter_input ( INPUT_GET , '_wpnonce ' , FILTER_SANITIZE_FULL_SPECIAL_CHARS );
28+
29+ if ( $ get_id === $ blog_id
30+ && $ get_nonce
31+ && wp_verify_nonce ( $ get_nonce , 'wp-cache ' . $ blog_id )
2832 ) {
29- if ( 'disable_cache ' === filter_input ( INPUT_GET , ' action ' ) ) {
33+ if ( 'disable_cache ' === $ get_action ) {
3034 add_blog_option ( $ blog_id , 'wp_super_cache_disabled ' , 1 );
31- } elseif ( 'enable_cache ' === filter_input ( INPUT_GET , ' action ' ) ) {
35+ } elseif ( 'enable_cache ' === $ get_action ) {
3236 delete_blog_option ( $ blog_id , 'wp_super_cache_disabled ' );
3337 }
3438 }
You can’t perform that action at this time.
0 commit comments