Skip to content

Commit

Permalink
ENGCOM-3160: Fix for #12969 - server port detection for errors #18393
Browse files Browse the repository at this point in the history
  • Loading branch information
Stanislav Idolov authored Oct 13, 2018
2 parents 936f258 + 0f6b986 commit a21092c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions pub/errors/processor.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -379,6 +380,8 @@ protected function _loadXml($xmlFile)
}

/**
* Render page
*
* @param string $template
* @return string
*/
Expand Down

0 comments on commit a21092c

Please sign in to comment.