From 82d513ec54ec0939c6c23c032ba508fd8293df3d Mon Sep 17 00:00:00 2001 From: Ryan Cramer Date: Tue, 12 Feb 2019 09:14:44 -0500 Subject: [PATCH] Update for processwire/processwire-issues#358 to prevent port 443 from being appended to undefined $config->httpHost when scheme is HTTPS. --- wire/core/ProcessWire.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/wire/core/ProcessWire.php b/wire/core/ProcessWire.php index 9ae2f631..4558ded8 100644 --- a/wire/core/ProcessWire.php +++ b/wire/core/ProcessWire.php @@ -313,7 +313,8 @@ class ProcessWire extends Wire { protected function getHttpHost(Config $config) { $httpHosts = $config->httpHosts; - $port = (isset($_SERVER['SERVER_PORT']) && $_SERVER['SERVER_PORT'] != 80) ? (':' . ((int) $_SERVER['SERVER_PORT'])) : ''; + $port = isset($_SERVER['SERVER_PORT']) ? (int) $_SERVER['SERVER_PORT'] : 80; + $port = ($port === 80 || $port === 443 ? "" : ":$port"); $host = ''; if(is_array($httpHosts) && count($httpHosts)) {