Skip to content

Commit

Permalink
Fix ControllerTestCase redirect
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark Scherer committed Jan 26, 2015
1 parent 76f7754 commit e753fba
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/Cake/Controller/Controller.php
Expand Up @@ -751,7 +751,7 @@ public function loadModel($modelClass = null, $id = null) {
*
* @param string|array $url A string or array-based URL pointing to another location within the app,
* or an absolute URL
* @param int $status Optional HTTP status code (eg: 404)
* @param int $status HTTP status code (eg: 301)
* @param bool $exit If true, exit() will be called after the redirect
* @return void
* @triggers Controller.beforeRedirect $this, array($url, $status, $exit)
Expand Down Expand Up @@ -785,6 +785,9 @@ public function redirect($url, $status = null, $exit = true) {
}
}

if ($status === null) {
$status = 302;
}
if ($status) {
$this->response->statusCode($status);
}
Expand Down

0 comments on commit e753fba

Please sign in to comment.