Make WordPress Core


Ignore:
Timestamp:
08/25/2015 11:24:39 PM (9 years ago)
Author:
SergeyBiryukov
Message:

Fire the check_ajax_referer action on failure as well as success.

See [33017] for check_admin_referer.

props egill.
fixes #33342.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/pluggable.php

    r33734 r33743  
    11401140    $result = wp_verify_nonce( $nonce, $action );
    11411141
    1142     if ( $die && false === $result ) {
    1143         if ( defined( 'DOING_AJAX' ) && DOING_AJAX )
    1144             wp_die( -1 );
    1145         else
    1146             die( '-1' );
    1147     }
    1148 
    11491142    /**
    11501143     * Fires once the AJAX request has been validated or not.
     
    11571150     */
    11581151    do_action( 'check_ajax_referer', $action, $result );
     1152
     1153    if ( $die && false === $result ) {
     1154        if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) {
     1155            wp_die( -1 );
     1156        } else {
     1157            die( '-1' );
     1158        }
     1159    }
    11591160
    11601161    return $result;
Note: See TracChangeset for help on using the changeset viewer.