Sanitizing is required when you are inserting user input into Database or outputting it in HTML etc. Here, you are simply doing a String comparison.
wp_verify_nonce
function checks $nonce
value like this:
if ( hash_equals( $expected, $nonce ) ) {
return 1;
}
For this you don’t need sanitizing. So the following is fine:
wp_verify_nonce( $_GET['some_nonce'], 'some_nonce' );
Related Posts:
- Should I sanitize an email address before passing it to the is_email() function?
- Escaping and sanitizing SVGs in metabox textarea
- What is the difference between wp_strip_all_tags and wp_filter_nohtml_kses?
- Reason for Lowercase usernames
- What is the best way to sanitize data?
- esc_url removes white space. Can I change that to using ‘-‘?
- WP Coding standards – escaping the inescapable?
- Sanitatizing when using the posts_where hook
- Escape hexadecimals/rgba values
- Must I serialize/sanitize/escape array data before using set_transient?
- Echo JavaScript Safely
- wp_kses ignore allowed and allow everything
- Sanitize array callback for the WordPress Settings API
- How to escape $_GET and check if isset?
- What’s a safe / good way to output HTML safely within WordPress templates?
- Do Not Understand → Rule No. 4: Making Data Safe Is About Context [closed]
- Sanitizing output that contains quotes?
- WP_Customize_Manager: How to get control ID
- How to use wp_filter_oembed_result?
- Sanitization html output itself
- Post text sanitization after publishing/editing – changes are not saved
- wp_set_object_terms() without accents
- Escaping data from database (users table) is necessary?
- Properly sanitize an input field “Name “
- In Which Contexts are Plugins Responsible for Data Validation/Sanitization?
- wordpress sanitize array?
- Should HTML output be passed through esc_html() AND wp_kses()?
- Are Nonces Useless?
- How to use nonce with front end submission form?
- Sanitize content from wp_editor
- Extend WordPress (4.x) session and nonce
- How to expire a nonce?
- Sanitize User Entered CSS
- Which KSES should be used and when?
- How do WordPress Nonces Work?
- Verify nonce in REST API?
- Do I require the use of nonce?
- Shortcode putting html such as
- How to add/retrieve the post trash link?
- how to sanitize checkbox input?
- Security – Ajax and Nonce use [closed]
- “The link you followed has expired” when previewing a post
- Undefined index: at_nonce in custom post metabox
- wp_verify_nonce keeps failing
- “Notice: Undefined index:” error when adding new content?
- Sanitizing `wp_editor();` Values for Database, Edit, and Display
- When is it useful to use wp_verify_nonce
- WordPress password reset – why post rp_key?
- How to save multiple metaboxes?
- Sanitizing search data for use with WP_Query
- Nonce failing in IE
- Nonce actions and names available via open source
- Nonces, AJAX, script variables & security in WordPress
- Multiple register settings, with same option name – issue
- How to get the wpnonce value?
- Filter string like a slug
- Sanitize textarea instead of input
- When must I use and verify nonce?
- Sanitizing, Validating and Escaping in WordPress (Plugin)
- How do I check if AJAX nonces are implemented correctly?
- Cannot get ‘sanitize_callback’ to work for rest parameters
- Change filename during upload
- wpdb get_results() and prepare when to use prepare?
- WP nonce invalid
- Preserve old values on error in setting API
- WP_Editor – Saving Value into Plugin Option – Stripping HTML
- Data sanitization for user registration and user login
- Draft preview and customize permission problems on multisite main site
- Why ajax doesn’t work on certain wordpress hooks and reload the page instead?
- Handling expired nonces
- Are un-sanitized theme options more vulnerable to malicious scripts than the theme editor?
- Is it safe to use a global wp nonce per user instead of a nonce per action?
- Does meta-data need to be sanitized?
- Backbone with custom rest endpoints
- Function sanitize_title() does not appear to be working
- Using nonce when loading posts with AJAX
- Several nonces?
- How to handle complex data with Settings API
- Toggle Shortcode Sanitize Title
- Saving custom data via ajax with nonces
- Sanitizing URL in a WordPress plugin
- Log in user using WordPress REST API
- WP_List_Table Inside Metabox With Bulk Actions Not Working on Submit
- how to sanitize customizer checkbox control
- How do I mitigate replay attacks when talking about actions that shouldn’t happen twice?
- do I need to sanitize a shortcode’s function input?
- How can I verify WordPress nonce from the following code?
- AJAX form not working, still reloads on submit
- Form Sanitization and Validation
- Data not displaying in text field
- Proper Way to Sanitize Meta Input
- Sanitize html, where to sanitize
- Save selectlist value (taxonomy) in wp:wp_set_object_terms
- Create nonce in frontend page to edit profile
- when saveing $meta_box i get Undefined index error
- Notice: Undefined index: in options-framework.php
- How to use esc_attr__() function properly to translate a variable that contains string?
- Weird nonce validation problem
- Saving metabox updates causing fatal error
- Extend file format support for post thumbnails