mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +00:00
Fixing notice error that could occur if csrfTokens ended up being null/not an array.
This commit is contained in:
parent
47cdaedc94
commit
e0420937a7
1 changed files with 1 additions and 1 deletions
|
@ -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']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue