Fixing notice error that could occur if csrfTokens ended up being null/not an array.

This commit is contained in:
mark_story 2011-02-11 22:30:51 -05:00
parent 47cdaedc94
commit e0420937a7

View file

@ -689,7 +689,7 @@ class SecurityComponent extends Component {
$tokenData = array(); $tokenData = array();
if ($this->Session->check('_Token')) { if ($this->Session->check('_Token')) {
$tokenData = $this->Session->read('_Token'); $tokenData = $this->Session->read('_Token');
if (!empty($tokenData['csrfTokens'])) { if (!empty($tokenData['csrfTokens']) && is_array($tokenData['csrfTokens'])) {
$token['csrfTokens'] = $this->_expireTokens($tokenData['csrfTokens']); $token['csrfTokens'] = $this->_expireTokens($tokenData['csrfTokens']);
} }
} }