Skip to content

Commit a21092c

Browse files
author
Stanislav Idolov
authored
ENGCOM-3160: Fix for #12969 - server port detection for errors #18393
2 parents 936f258 + 0f6b986 commit a21092c

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

pub/errors/processor.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -268,10 +268,11 @@ public function getHostUrl()
268268
$isSecure = (!empty($_SERVER['HTTPS'])) && ($_SERVER['HTTPS'] != 'off');
269269
$url = ($isSecure ? 'https://' : 'http://') . $host;
270270

271-
if (!empty($_SERVER['SERVER_PORT']) && !in_array($_SERVER['SERVER_PORT'], [80, 443])
271+
$port = explode(':', $host);
272+
if (isset($port[1]) && !in_array($port[1], [80, 443])
272273
&& !preg_match('/.*?\:[0-9]+$/', $url)
273274
) {
274-
$url .= ':' . $_SERVER['SERVER_PORT'];
275+
$url .= ':' . $port[1];
275276
}
276277
return $url;
277278
}
@@ -379,6 +380,8 @@ protected function _loadXml($xmlFile)
379380
}
380381

381382
/**
383+
* Render page
384+
*
382385
* @param string $template
383386
* @return string
384387
*/

0 commit comments

Comments
 (0)