Type check before unset()

Calling unset() on string indices fails fatally on 5.3.x and lower.

Fixes #3027
This commit is contained in:
mark_story 2012-07-11 15:54:24 -04:00
parent b7415525c8
commit 3baaecc81c

View file

@ -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']);
}
}