WordPress-Coding-Standards icon indicating copy to clipboard operation
WordPress-Coding-Standards copied to clipboard

Add sniff to check that WP is killed in ajax response functions

Open jrfnl opened this issue 8 years ago • 1 comments

Check that any function containing a check_ajax_referer( ... ); call, also contains a call to die(), wp_die() or exit at the end of the same function.

This should be a warning, not an error and will need a whitelist comment as the kill call may be delegated to a function which is called from within the function checking the referrer.

[Edit]: calls to wp_send_json(), wp_send_json_success() and wp_send_json_error() should also be accepted as a way to kill WP as they die.

jrfnl avatar Oct 20 '17 05:10 jrfnl

Loosely related to #1205

jrfnl avatar Dec 09 '22 10:12 jrfnl