mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Removed triple nested condition.
This commit is contained in:
parent
2be9ac8888
commit
c9e59c3b51
1 changed files with 7 additions and 6 deletions
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue