Use `elseif` when slurping the `nonce` in `check_ajax_referer()` to avoid accidentally overwriting it.
Fail wonderboymusic in [25433]. Props ocean90. Fixes #25369. See [25433]. Built from https://develop.svn.wordpress.org/trunk@25550 git-svn-id: http://core.svn.wordpress.org/trunk@25470 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
68bd14f4bf
commit
c2312dfe4c
|
@ -832,13 +832,11 @@ if ( !function_exists('check_ajax_referer') ) :
|
||||||
function check_ajax_referer( $action = -1, $query_arg = false, $die = true ) {
|
function check_ajax_referer( $action = -1, $query_arg = false, $die = true ) {
|
||||||
$nonce = '';
|
$nonce = '';
|
||||||
|
|
||||||
if ( $query_arg && isset( $_REQUEST[$query_arg] ) )
|
if ( $query_arg && isset( $_REQUEST[ $query_arg ] ) )
|
||||||
$nonce = $_REQUEST[$query_arg];
|
$nonce = $_REQUEST[ $query_arg ];
|
||||||
|
elseif ( isset( $_REQUEST['_ajax_nonce'] ) )
|
||||||
if ( isset( $_REQUEST['_ajax_nonce'] ) )
|
|
||||||
$nonce = $_REQUEST['_ajax_nonce'];
|
$nonce = $_REQUEST['_ajax_nonce'];
|
||||||
|
elseif ( isset( $_REQUEST['_wpnonce'] ) )
|
||||||
if ( isset( $_REQUEST['_wpnonce'] ) )
|
|
||||||
$nonce = $_REQUEST['_wpnonce'];
|
$nonce = $_REQUEST['_wpnonce'];
|
||||||
|
|
||||||
$result = wp_verify_nonce( $nonce, $action );
|
$result = wp_verify_nonce( $nonce, $action );
|
||||||
|
|
Loading…
Reference in New Issue