Permalink
Browse files

Type check before unset()

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

Fixes #3027
  • Loading branch information...
1 parent b741552 commit 3baaecc81c629aab0e3b0730000a30f859e42de7 @markstory markstory committed Jul 11, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/Cake/Controller/Component/SecurityComponent.php
@@ -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']);
}
}

0 comments on commit 3baaecc

Please sign in to comment.