Improve code style

This commit is contained in:
Val Bancer 2018-11-17 20:55:42 +01:00
parent 261a99c0e3
commit 509accc421
2 changed files with 4 additions and 5 deletions

View file

@ -271,8 +271,10 @@ class RequestHandlerComponent extends Component {
} }
if (!empty($status)) { if (!empty($status)) {
$statusCode = $this->response->httpCodes($status); $statusCode = $this->response->httpCodes($status);
$code = key($statusCode); if (is_array($statusCode)) {
$this->response->statusCode($code); $code = key($statusCode);
$this->response->statusCode($code);
}
} }
$this->response->body($this->requestAction($url, array('return', 'bare' => false))); $this->response->body($this->requestAction($url, array('return', 'bare' => false)));
$this->response->send(); $this->response->send();

View file

@ -1318,9 +1318,6 @@ class CakeResponse {
continue; continue;
} }
$original = $domain; $original = $domain;
if (strpos($domain, '://') === false) {
$preg = ($requestIsSSL ? 'https://' : 'http://') . $domain;
}
$preg = '@' . str_replace('*', '.*', $domain) . '@'; $preg = '@' . str_replace('*', '.*', $domain) . '@';
$result[] = compact('original', 'preg'); $result[] = compact('original', 'preg');
} }