Make WordPress Core


Ignore:
Timestamp:
06/21/2013 02:11:31 AM (12 years ago)
Author:
nacin
Message:

Add strict check to wp_verify_nonce() to avoid issues when it is improperly called.

File:
1 edited

Legend:

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

    r23814 r24461  
    12601260
    12611261    // Nonce generated 0-12 hours ago
    1262     if ( substr(wp_hash($i . $action . $uid, 'nonce'), -12, 10) == $nonce )
     1262    if ( substr(wp_hash($i . $action . $uid, 'nonce'), -12, 10) === $nonce )
    12631263        return 1;
    12641264    // Nonce generated 12-24 hours ago
    1265     if ( substr(wp_hash(($i - 1) . $action . $uid, 'nonce'), -12, 10) == $nonce )
     1265    if ( substr(wp_hash(($i - 1) . $action . $uid, 'nonce'), -12, 10) === $nonce )
    12661266        return 2;
    12671267    // Invalid nonce
Note: See TracChangeset for help on using the changeset viewer.