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