Removed triple nested condition.

This commit is contained in:
Phally 2012-05-05 17:09:43 +02:00 committed by Jose Lorenzo Rodriguez
parent 2be9ac8888
commit c9e59c3b51

View file

@ -774,13 +774,14 @@ class Controller extends Object implements CakeEventListener {
$this->response->header('Location', Router::url($url, true)); $this->response->header('Location', Router::url($url, true));
} }
if (!empty($status)) {
if (is_string($status)) { if (is_string($status)) {
$codes = array_flip($this->response->httpCodes()); $codes = array_flip($this->response->httpCodes());
if (isset($codes[$status])) { if (isset($codes[$status])) {
$status = $codes[$status]; $status = $codes[$status];
} }
} }
if ($status) {
$this->response->statusCode($status); $this->response->statusCode($status);
} }