| @@ -422,9 +422,9 @@ | ||
| 422 | 422 | * |
| 423 | 423 | * @return void |
| 424 | 424 | */ |
| 425 | 425 | public static function ajax_switch_version(): void { |
| 426 | - check_ajax_referer( 'code_snippets_version_switch', sanitize_text_field( wp_unslash( $_POST['nonce'] ?? '' ) ) ); | |
| 426 | + check_ajax_referer( 'code_snippets_version_switch', 'nonce' ); | |
| 427 | 427 | |
| 428 | 428 | if ( ! current_user_can( 'update_plugins' ) ) { |
| 429 | 429 | wp_send_json_error( [ 'message' => __( 'You do not have permission to update plugins.', 'code-snippets' ) ] ); |
| 430 | 430 | } |
| @@ -466,9 +466,9 @@ | ||
| 466 | 466 | * |
| 467 | 467 | * @return void |
| 468 | 468 | */ |
| 469 | 469 | public static function ajax_refresh_versions(): void { |
| 470 | - check_ajax_referer( 'code_snippets_refresh_versions', sanitize_text_field( wp_unslash( $_POST['nonce'] ?? '' ) ) ); | |
| 470 | + check_ajax_referer( 'code_snippets_refresh_versions', 'nonce' ); | |
| 471 | 471 | |
| 472 | 472 | if ( ! code_snippets()->current_user_can() ) { |
| 473 | 473 | wp_send_json_error( [ 'message' => __( 'You do not have permission to manage options.', 'code-snippets' ) ] ); |
| 474 | 474 | } |