mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-03-12 20:49:50 +00:00
Type check before unset()
Calling unset() on string indices fails fatally on 5.3.x and lower. Fixes #3027
This commit is contained in:
parent
b7415525c8
commit
3baaecc81c
1 changed files with 1 additions and 1 deletions
|
@ -229,7 +229,7 @@ class SecurityComponent extends Component {
|
|||
}
|
||||
}
|
||||
$this->generateToken($controller->request);
|
||||
if ($isPost) {
|
||||
if ($isPost && is_array($controller->request->data)) {
|
||||
unset($controller->request->data['_Token']);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue