From 361531509e3e7f1f67fe6811b9c36a0b3abd161c Mon Sep 17 00:00:00 2001 From: Melvin Ross Date: Thu, 12 Jun 2014 08:47:40 -0500 Subject: [PATCH] Fix coding standard violations --- lib/Cake/Network/CakeSocket.php | 4 ++-- lib/Cake/Network/Http/HttpSocket.php | 8 +++----- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/lib/Cake/Network/CakeSocket.php b/lib/Cake/Network/CakeSocket.php index 4fafda628..a18cdea2a 100755 --- a/lib/Cake/Network/CakeSocket.php +++ b/lib/Cake/Network/CakeSocket.php @@ -131,8 +131,8 @@ class CakeSocket { } $scheme = null; - if (!empty($this->config['protocol']) && strpos($this->config['host'], '://') === false) { - $scheme = $this->config['protocol'].'://'; + if (!empty($this->config['protocol']) && strpos($this->config['host'], '://') === false) { + $scheme = $this->config['protocol'] . '://'; } if (!empty($this->config['context'])) { diff --git a/lib/Cake/Network/Http/HttpSocket.php b/lib/Cake/Network/Http/HttpSocket.php index f096a4929..3c8a1c171 100755 --- a/lib/Cake/Network/Http/HttpSocket.php +++ b/lib/Cake/Network/Http/HttpSocket.php @@ -341,8 +341,8 @@ class HttpSocket extends CakeSocket { if (!empty($this->request['body']) && !isset($this->request['header']['Content-Length'])) { $this->request['header']['Content-Length'] = strlen($this->request['body']); } - if(isset($this->request['uri']['scheme']) && $this->request['uri']['scheme'] === 'https'){ - $this->config['protocol'] = 'ssl'; + if (isset($this->request['uri']['scheme']) && $this->request['uri']['scheme'] === 'https' && empty($this->config['protocol'])) { + $this->config['protocol'] = 'ssl'; } $connectionType = null; @@ -525,7 +525,7 @@ class HttpSocket extends CakeSocket { } /** - * Issues a HEADER request to the specified URI, query, and request. + * Issues a HEAD request to the specified URI, query, and request. * * @param string|array $uri URI to request (see {@link _parseUri()}) * @param array $data Array of request body data keys and values. @@ -537,8 +537,6 @@ class HttpSocket extends CakeSocket { return $this->request($request); } - - /** * Normalizes URLs into a $uriTemplate. If no template is provided * a default one will be used. Will generate the URL using the