Skip to content
Permalink
Browse files

Removed triple nested condition.

  • Loading branch information...
Phally committed May 5, 2012
1 parent 7bb56e7 commit 985d6809f13c06bfd1da27ca93c358082f92c6f6
Showing with 7 additions and 6 deletions.
  1. +7 −6 lib/Cake/Controller/Controller.php
@@ -774,13 +774,14 @@ public function redirect($url, $status = null, $exit = true) {
$this->response->header('Location', Router::url($url, true));
}
if (!empty($status)) {
if (is_string($status)) {
$codes = array_flip($this->response->httpCodes());
if (isset($codes[$status])) {
$status = $codes[$status];
}
if (is_string($status)) {
$codes = array_flip($this->response->httpCodes());
if (isset($codes[$status])) {
$status = $codes[$status];
}
}
if ($status) {
$this->response->statusCode($status);
}

0 comments on commit 985d680

Please sign in to comment.
You can’t perform that action at this time.