Permalink
Browse files

Merge branch 'master' into 2.3

Conflicts:
	lib/Cake/Controller/Component/SecurityComponent.php
  • Loading branch information...
2 parents ec264fc + 1117ad2 commit 4c98e39c1fb274c472f5636a3ed235e239f9f915 @markstory markstory committed Dec 29, 2012
@@ -225,6 +225,10 @@ public function startup(Controller $controller) {
$controller->request->params['requested'] != 1
);
+ if ($this->_action == $this->blackHoleCallback) {
+ return $this->blackhole($controller, 'auth');
+ }
+
if (!in_array($this->_action, (array)$this->unlockedActions) && $isPost && $isNotRequestAction) {
if ($this->validatePost && $this->_validatePost($controller) === false) {
return $this->blackHole($controller, 'auth');
@@ -195,6 +195,22 @@ public function testBlackholeWithBrokenCallback() {
}
/**
+ * Ensure that directly requesting the blackholeCallback as the controller
+ * action results in an exception.
+ *
+ * @return void
+ */
+ public function testExceptionWhenActionIsBlackholeCallback() {
+ $this->Controller->request->addParams(array(
+ 'controller' => 'posts',
+ 'action' => 'fail'
+ ));
+ $this->assertFalse($this->Controller->failed);
+ $this->Controller->Security->startup($this->Controller);
+ $this->assertTrue($this->Controller->failed, 'Request was blackholed.');
+ }
+
+/**
* test that initialize can set properties.
*
* @return void

0 comments on commit 4c98e39

Please sign in to comment.