1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-25 23:56:41 +02:00

Update for processwire/processwire-issues#358 to prevent port 443 from being appended to undefined $config->httpHost when scheme is HTTPS.

This commit is contained in:
Ryan Cramer
2019-02-12 09:14:44 -05:00
parent feb071b006
commit 82d513ec54

View File

@@ -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)) {