Permalink
Browse files
Fix undefined variable error.
- Loading branch information...
Showing
with
1 addition
and
1 deletion.
-
+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