Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Removed triple nested condition.

  • Loading branch information...
commit 985d6809f13c06bfd1da27ca93c358082f92c6f6 1 parent 7bb56e7
@Phally Phally authored
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);
}
Please sign in to comment.
Something went wrong with that request. Please try again.