@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | */ |
| 36 | 36 | public function getCurrentUrl() |
| 37 | 37 | { |
| 38 | - return $this->getHttpScheme() . '://' . $this->getHostName() . $this->getServerVar('REQUEST_URI'); |
|
| 38 | + return $this->getHttpScheme().'://'.$this->getHostName().$this->getServerVar('REQUEST_URI'); |
|
| 39 | 39 | } |
| 40 | 40 | |
| 41 | 41 | /** |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | return $this->protocolWithActiveSsl($protocol); |
| 67 | 67 | } |
| 68 | 68 | |
| 69 | - return (string)$this->getServerVar('SERVER_PORT') === '443'; |
|
| 69 | + return (string) $this->getServerVar('SERVER_PORT') === '443'; |
|
| 70 | 70 | } |
| 71 | 71 | |
| 72 | 72 | /** |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | */ |
| 79 | 79 | protected function protocolWithActiveSsl($protocol) |
| 80 | 80 | { |
| 81 | - $protocol = strtolower((string)$protocol); |
|
| 81 | + $protocol = strtolower((string) $protocol); |
|
| 82 | 82 | |
| 83 | 83 | return in_array($protocol, ['on', '1', 'https', 'ssl'], true); |
| 84 | 84 | } |
@@ -111,14 +111,14 @@ discard block |
||
| 111 | 111 | // Port number |
| 112 | 112 | $scheme = $this->getHttpScheme(); |
| 113 | 113 | $port = $this->getCurrentPort(); |
| 114 | - $appendPort = ':' . $port; |
|
| 114 | + $appendPort = ':'.$port; |
|
| 115 | 115 | |
| 116 | 116 | // Don't append port number if a normal port. |
| 117 | 117 | if (($scheme == 'http' && $port == '80') || ($scheme == 'https' && $port == '443')) { |
| 118 | 118 | $appendPort = ''; |
| 119 | 119 | } |
| 120 | 120 | |
| 121 | - return $host . $appendPort; |
|
| 121 | + return $host.$appendPort; |
|
| 122 | 122 | } |
| 123 | 123 | |
| 124 | 124 | protected function getCurrentPort() |
@@ -126,15 +126,15 @@ discard block |
||
| 126 | 126 | // Check for proxy first |
| 127 | 127 | $port = $this->getHeader('X_FORWARDED_PORT'); |
| 128 | 128 | if ($port) { |
| 129 | - return (string)$port; |
|
| 129 | + return (string) $port; |
|
| 130 | 130 | } |
| 131 | 131 | |
| 132 | - $protocol = (string)$this->getHeader('X_FORWARDED_PROTO'); |
|
| 132 | + $protocol = (string) $this->getHeader('X_FORWARDED_PROTO'); |
|
| 133 | 133 | if ($protocol === 'https') { |
| 134 | 134 | return '443'; |
| 135 | 135 | } |
| 136 | 136 | |
| 137 | - return (string)$this->getServerVar('SERVER_PORT'); |
|
| 137 | + return (string) $this->getServerVar('SERVER_PORT'); |
|
| 138 | 138 | } |
| 139 | 139 | |
| 140 | 140 | /** |
@@ -158,7 +158,7 @@ discard block |
||
| 158 | 158 | */ |
| 159 | 159 | protected function getHeader($key) |
| 160 | 160 | { |
| 161 | - return $this->getServerVar('HTTP_' . $key); |
|
| 161 | + return $this->getServerVar('HTTP_'.$key); |
|
| 162 | 162 | } |
| 163 | 163 | |
| 164 | 164 | /** |
@@ -177,7 +177,7 @@ discard block |
||
| 177 | 177 | |
| 178 | 178 | return return (preg_match("/^([a-z\d](-*[a-z\d])*)(\.([a-z\d](-*[a-z\d])*))*$/i", $domain_name) //valid chars check |
| 179 | 179 | && preg_match("/^.{1,253}$/", $domain_name) //overall length check |
| 180 | - && preg_match("/^[^\.]{1,63}(\.[^\.]{1,63})*$/", $domain_name) ); //length of each label |
|
| 180 | + && preg_match("/^[^\.]{1,63}(\.[^\.]{1,63})*$/", $domain_name)); //length of each label |
|
| 181 | 181 | } |
| 182 | 182 | |
| 183 | 183 | } |