Make WordPress Core

Ticket #25369: 25369.patch

File 25369.patch, 807 bytes (added by ocean90, 11 years ago)
  • src/wp-includes/pluggable.php

     
    832832function check_ajax_referer( $action = -1, $query_arg = false, $die = true ) {
    833833        $nonce = '';
    834834
    835         if ( $query_arg && isset( $_REQUEST[$query_arg] ) )
    836                 $nonce = $_REQUEST[$query_arg];
    837 
    838         if ( isset( $_REQUEST['_ajax_nonce'] ) )
     835        if ( $query_arg && isset( $_REQUEST[ $query_arg ] ) )
     836                $nonce = $_REQUEST[ $query_arg ];
     837        elseif ( isset( $_REQUEST['_ajax_nonce'] ) )
    839838                $nonce = $_REQUEST['_ajax_nonce'];
    840 
    841         if ( isset( $_REQUEST['_wpnonce'] ) )
     839        elseif ( isset( $_REQUEST['_wpnonce'] ) )
    842840                $nonce = $_REQUEST['_wpnonce'];
    843841
    844842        $result = wp_verify_nonce( $nonce, $action );