Fix undefined variable error.

This commit is contained in:
mark_story 2011-12-06 12:35:18 -05:00
parent fc4846d676
commit 545694d84b

View file

@ -553,12 +553,12 @@ class SecurityComponent extends Component {
* @return array An array of nonce => expires. * @return array An array of nonce => expires.
*/ */
protected function _expireTokens($tokens) { protected function _expireTokens($tokens) {
$now = time();
foreach ($tokens as $nonce => $expires) { foreach ($tokens as $nonce => $expires) {
if ($expires < $now) { if ($expires < $now) {
unset($tokens[$nonce]); unset($tokens[$nonce]);
} }
} }
$now = time();
$overflow = count($tokens) - $this->csrfLimit; $overflow = count($tokens) - $this->csrfLimit;
if ($overflow > 0) { if ($overflow > 0) {
$tokens = array_slice($tokens, $overflow + 1, null, true); $tokens = array_slice($tokens, $overflow + 1, null, true);