Skip to content

Commit

Permalink
Type check before unset()
Browse files Browse the repository at this point in the history
Calling unset() on string indices fails fatally on 5.3.x and lower.

Fixes #3027
  • Loading branch information
markstory committed Jul 11, 2012
1 parent b741552 commit 3baaecc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Cake/Controller/Component/SecurityComponent.php
Expand Up @@ -229,7 +229,7 @@ public function startup(Controller $controller) {
}
}
$this->generateToken($controller->request);
if ($isPost) {
if ($isPost && is_array($controller->request->data)) {
unset($controller->request->data['_Token']);
}
}
Expand Down

0 comments on commit 3baaecc

Please sign in to comment.