Skip to content

Commit

Permalink
Safety check for array of nonces
Browse files Browse the repository at this point in the history
  • Loading branch information
rhukster committed Jan 7, 2016
1 parent e0632de commit eb29d68
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions system/src/Grav/Common/Utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -560,6 +560,11 @@ public static function getNonceOldStyle($action, $plusOneTick = false)
*/
public static function verifyNonce($nonce, $action)
{
//Safety check for multiple nonces
if (is_array($nonce)) {
$nonce = array_shift($nonce);
}

//Nonce generated 0-12 hours ago
if ($nonce == self::getNonce($action)) {
return true;
Expand Down

0 comments on commit eb29d68

Please sign in to comment.