mirror of
https://github.com/the-djmaze/snappymail.git
synced 2024-11-10 17:13:38 +08:00
Update Http.php
Cleanup a bit
This commit is contained in:
parent
3caeae8ea6
commit
8406bd4c9f
1 changed files with 2 additions and 2 deletions
|
@ -129,7 +129,7 @@ class Http
|
||||||
public function GetHost(bool $bWithRemoteUserData = false, bool $bWithoutWWW = true, bool $bWithoutPort = false) : string
|
public function GetHost(bool $bWithRemoteUserData = false, bool $bWithoutWWW = true, bool $bWithoutPort = false) : string
|
||||||
{
|
{
|
||||||
$sHost = $this->GetServer('HTTP_HOST', '');
|
$sHost = $this->GetServer('HTTP_HOST', '');
|
||||||
if (0 === \strlen($sHost))
|
if (!\strlen($sHost))
|
||||||
{
|
{
|
||||||
$sName = $this->GetServer('SERVER_NAME');
|
$sName = $this->GetServer('SERVER_NAME');
|
||||||
$iPort = (int) $this->GetServer('SERVER_PORT', 80);
|
$iPort = (int) $this->GetServer('SERVER_PORT', 80);
|
||||||
|
@ -150,7 +150,7 @@ class Http
|
||||||
|
|
||||||
if ($bWithoutPort)
|
if ($bWithoutPort)
|
||||||
{
|
{
|
||||||
$sHost = \preg_replace('/:[\d]+$/', '', $sHost);
|
$sHost = \preg_replace('/:\d+$/', '', $sHost);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $sHost;
|
return $sHost;
|
||||||
|
|
Loading…
Reference in a new issue