diff --git a/system/typemill/Controllers/ControllerWebSystem.php b/system/typemill/Controllers/ControllerWebSystem.php index 06a6e39..c69909a 100644 --- a/system/typemill/Controllers/ControllerWebSystem.php +++ b/system/typemill/Controllers/ControllerWebSystem.php @@ -196,16 +196,16 @@ class ControllerWebSystem extends Controller { $licensefields[$key]['disabled'] = true; } - } - # check license data - $licensecheck = $license->checkLicense($licensedata, $this->c->get('urlinfo')); - if(!$licensecheck) - { - $message = $license->getMessage(); - } + # check license data + $licensecheck = $license->checkLicense($licensedata, $this->c->get('urlinfo')); + if(!$licensecheck) + { + $message = $license->getMessage(); + } - unset($licensedata['signature']); + unset($licensedata['signature']); + } return $this->c->get('view')->render($response, 'system/license.twig', [ 'settings' => $this->settings, diff --git a/system/typemill/Static/Urlinfo.php b/system/typemill/Static/Urlinfo.php index 39ca57a..9f5db40 100644 --- a/system/typemill/Static/Urlinfo.php +++ b/system/typemill/Static/Urlinfo.php @@ -69,7 +69,7 @@ class Urlinfo private static function removeStandardPorts($uri) { $port = $uri->getPort(); - if ($port == 80 || $port == 443) + if (!$port || $port == 80 || $port == 443) { $uri = $uri->withPort(null); } diff --git a/system/typemill/settings/system.yaml b/system/typemill/settings/system.yaml index 98d50b5..938260d 100644 --- a/system/typemill/settings/system.yaml +++ b/system/typemill/settings/system.yaml @@ -239,6 +239,9 @@ fieldsetdeveloper: trustedproxies: type: text label: "Trusted IPs for proxies (comma separated)" + fqdn: + type: text + label: "If your proxy does not work, try to add the base-url of your proxy here like https://mywebsite.com." headersoff: type: checkbox label: "Disable Custom Headers" diff --git a/system/typemill/system.php b/system/typemill/system.php index 65209c3..ea1d793 100644 --- a/system/typemill/system.php +++ b/system/typemill/system.php @@ -119,6 +119,21 @@ $app->setBasePath($basepath); $uriFactory = new UriFactory(); $uri = $uriFactory->createFromGlobals($_SERVER); + +if( + isset($settings['proxy']) && + $settings['proxy'] && + isset($_SERVER['HTTP_X_FORWARDED_HOST']) && + isset($settings['fqdn']) && + $settings['fqdn'] != '' +) +{ + $fqdn = $uriFactory->createUri($settings['fqdn']); + $uri = $uri->withScheme($fqdn->getScheme()) + ->withHost($fqdn->getHost()) + ->withPort($fqdn->getPort()); +} + $urlinfo = Urlinfo::getUrlInfo($basepath, $uri, $settings); $timer['settings'] = microtime(true);