Fire the check_ajax_referer
action on failure as well as success.
See [33017] for `check_admin_referer`. props egill. fixes #33342. git-svn-id: https://develop.svn.wordpress.org/trunk@33743 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
6598033243
commit
4bc9b3db6d
@ -1139,13 +1139,6 @@ function check_ajax_referer( $action = -1, $query_arg = false, $die = true ) {
|
||||
|
||||
$result = wp_verify_nonce( $nonce, $action );
|
||||
|
||||
if ( $die && false === $result ) {
|
||||
if ( defined( 'DOING_AJAX' ) && DOING_AJAX )
|
||||
wp_die( -1 );
|
||||
else
|
||||
die( '-1' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Fires once the AJAX request has been validated or not.
|
||||
*
|
||||
@ -1157,6 +1150,14 @@ function check_ajax_referer( $action = -1, $query_arg = false, $die = true ) {
|
||||
*/
|
||||
do_action( 'check_ajax_referer', $action, $result );
|
||||
|
||||
if ( $die && false === $result ) {
|
||||
if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) {
|
||||
wp_die( -1 );
|
||||
} else {
|
||||
die( '-1' );
|
||||
}
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
endif;
|
||||
|
Loading…
Reference in New Issue
Block a user