From 509accc421cd0e10f9172fafe4d066ac013a182e Mon Sep 17 00:00:00 2001 From: Val Bancer Date: Sat, 17 Nov 2018 20:55:42 +0100 Subject: [PATCH] Improve code style --- lib/Cake/Controller/Component/RequestHandlerComponent.php | 6 ++++-- lib/Cake/Network/CakeResponse.php | 3 --- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/lib/Cake/Controller/Component/RequestHandlerComponent.php b/lib/Cake/Controller/Component/RequestHandlerComponent.php index 6b1588bd6..df6ca78d0 100644 --- a/lib/Cake/Controller/Component/RequestHandlerComponent.php +++ b/lib/Cake/Controller/Component/RequestHandlerComponent.php @@ -271,8 +271,10 @@ class RequestHandlerComponent extends Component { } if (!empty($status)) { $statusCode = $this->response->httpCodes($status); - $code = key($statusCode); - $this->response->statusCode($code); + if (is_array($statusCode)) { + $code = key($statusCode); + $this->response->statusCode($code); + } } $this->response->body($this->requestAction($url, array('return', 'bare' => false))); $this->response->send(); diff --git a/lib/Cake/Network/CakeResponse.php b/lib/Cake/Network/CakeResponse.php index 4aa7eb076..c172a78b7 100644 --- a/lib/Cake/Network/CakeResponse.php +++ b/lib/Cake/Network/CakeResponse.php @@ -1318,9 +1318,6 @@ class CakeResponse { continue; } $original = $domain; - if (strpos($domain, '://') === false) { - $preg = ($requestIsSSL ? 'https://' : 'http://') . $domain; - } $preg = '@' . str_replace('*', '.*', $domain) . '@'; $result[] = compact('original', 'preg'); }