Permalink
Browse files

Fix undefined variable error.

  • Loading branch information...
markstory committed Dec 6, 2011
1 parent fc4846d commit 545694d84b2fd9c63d4961386e9691df6251834f
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/Cake/Controller/Component/SecurityComponent.php
@@ -553,12 +553,12 @@ protected function _validateCsrf($controller) {
* @return array An array of nonce => expires.
*/
protected function _expireTokens($tokens) {
+ $now = time();
foreach ($tokens as $nonce => $expires) {
if ($expires < $now) {
unset($tokens[$nonce]);
}
}
- $now = time();
$overflow = count($tokens) - $this->csrfLimit;
if ($overflow > 0) {
$tokens = array_slice($tokens, $overflow + 1, null, true);

0 comments on commit 545694d

Please sign in to comment.