Browse files

Removed triple nested condition.

  • Loading branch information...
1 parent 2be9ac8 commit c9e59c3b51c31113633cd33bfb4fb1e8ed36f033 @Phally Phally committed with lorenzo May 5, 2012
Showing with 7 additions and 6 deletions.
  1. +7 −6 lib/Cake/Controller/Controller.php
View
13 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 c9e59c3

Please sign in to comment.