| @@ -219,9 +219,10 @@ | ||
| 219 | 219 | * |
| 220 | 220 | * @return void |
| 221 | 221 | */ |
| 222 | 222 | public function ajax_handler() { |
| 223 | - if ( ! isset( $_REQUEST['nonce'] ) || ! is_string( $_REQUEST['nonce'] ) || ! wp_verify_nonce( sanitize_text_field( wp_unslash( $_REQUEST['nonce'] ) ), 'content_control_upgrades' ) ) { | |
| 223 | + // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized | |
| 224 | + if ( ! isset( $_REQUEST['nonce'] ) || ! wp_verify_nonce( wp_unslash( $_REQUEST['nonce'] ), 'content_control_upgrades' ) ) { | |
| 224 | 225 | wp_send_json_error( __( 'Invalid nonce.', 'content-control' ) ); |
| 225 | 226 | } |
| 226 | 227 | |
| 227 | 228 | if ( ! current_user_can( $this->container->get_permission( 'manage_settings' ) ) ) { |
| @@ -320,9 +321,10 @@ | ||
| 320 | 321 | * |
| 321 | 322 | * @return void |
| 322 | 323 | */ |
| 323 | 324 | public function ajax_handler_demo() { |
| 324 | - if ( ! isset( $_REQUEST['nonce'] ) || ! is_string( $_REQUEST['nonce'] ) || ! wp_verify_nonce( sanitize_text_field( wp_unslash( $_REQUEST['nonce'] ) ), 'content_control_upgrades' ) ) { | |
| 325 | + // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized | |
| 326 | + if ( ! isset( $_REQUEST['nonce'] ) || ! wp_verify_nonce( wp_unslash( $_REQUEST['nonce'] ), 'content_control_upgrades' ) ) { | |
| 325 | 327 | wp_send_json_error( __( 'Invalid nonce.', 'content-control' ) ); |
| 326 | 328 | } |
| 327 | 329 | |
| 328 | 330 | if ( ! current_user_can( $this->container->get_permission( 'manage_settings' ) ) ) { |