From ef426a722fd4bb80470329f83d5a08f7a0424064 Mon Sep 17 00:00:00 2001 From: Logan Stellway Date: Thu, 4 Oct 2018 15:36:06 -0700 Subject: [PATCH 1/3] Fix for #12969 - server port detection for errors Updates `getHostUrl()` method to reference `HTTP_HOST` rather than `SERVER_PORT`. --- pub/errors/processor.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pub/errors/processor.php b/pub/errors/processor.php index 7240707f642c2..615a0c0f96ec3 100644 --- a/pub/errors/processor.php +++ b/pub/errors/processor.php @@ -268,10 +268,11 @@ public function getHostUrl() $isSecure = (!empty($_SERVER['HTTPS'])) && ($_SERVER['HTTPS'] != 'off'); $url = ($isSecure ? 'https://' : 'http://') . $host; - if (!empty($_SERVER['SERVER_PORT']) && !in_array($_SERVER['SERVER_PORT'], [80, 443]) + $port = explode(':', $host); + if (isset($port[1]) && !in_array($port[1], [80, 443]) && !preg_match('/.*?\:[0-9]+$/', $url) ) { - $url .= ':' . $_SERVER['SERVER_PORT']; + $url .= ':' . $port[1]; } return $url; } From 774a8a25688bd93cedc5b44cc79c9251a221d25b Mon Sep 17 00:00:00 2001 From: Logan Stellway Date: Mon, 8 Oct 2018 09:10:59 -0700 Subject: [PATCH 2/3] Updates docblock comment for _renderPage() method --- pub/errors/processor.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pub/errors/processor.php b/pub/errors/processor.php index 615a0c0f96ec3..8b37798f468b8 100644 --- a/pub/errors/processor.php +++ b/pub/errors/processor.php @@ -380,6 +380,8 @@ protected function _loadXml($xmlFile) } /** + * Render page + * * @param string $template * @return string */ From 763be496a1c19e0008524a0eab8c1ae7554a2609 Mon Sep 17 00:00:00 2001 From: Logan Stellway Date: Tue, 9 Oct 2018 07:52:02 -0700 Subject: [PATCH 3/3] Removes white space from end of line 384 --- pub/errors/processor.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pub/errors/processor.php b/pub/errors/processor.php index 8b37798f468b8..e64956dce17c2 100644 --- a/pub/errors/processor.php +++ b/pub/errors/processor.php @@ -381,7 +381,7 @@ protected function _loadXml($xmlFile) /** * Render page - * + * * @param string $template * @return string */