mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-05 07:27:04 +03:00
CardDAV (pre-release)
This commit is contained in:
parent
7a8fffede8
commit
639d8c58f6
38 changed files with 525 additions and 207 deletions
|
|
@ -290,11 +290,12 @@ class Http
|
|||
|
||||
/**
|
||||
* @param bool $bWithRemoteUserData = false
|
||||
* @param bool $bRemoveWWW = true
|
||||
* @param bool $bWithoutWWW = true
|
||||
* @param bool $bWithoutPort = false
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function GetHost($bWithRemoteUserData = false, $bRemoveWWW = true)
|
||||
public function GetHost($bWithRemoteUserData = false, $bWithoutWWW = true, $bWithoutPort = false)
|
||||
{
|
||||
$sHost = $this->GetServer('HTTP_HOST', '');
|
||||
if (0 === \strlen($sHost))
|
||||
|
|
@ -307,7 +308,7 @@ class Http
|
|||
? $sName : $sName.':'.$iPort;
|
||||
}
|
||||
|
||||
if ($bRemoveWWW)
|
||||
if ($bWithoutWWW)
|
||||
{
|
||||
$sHost = 'www.' === \substr(\strtolower($sHost), 0, 4) ? \substr($sHost, 4) : $sHost;
|
||||
}
|
||||
|
|
@ -318,6 +319,11 @@ class Http
|
|||
$sHost = (0 < \strlen($sUser) ? $sUser.'@' : '').$sHost;
|
||||
}
|
||||
|
||||
if ($bWithoutPort)
|
||||
{
|
||||
$sHost = \preg_replace('/:[\d]+$/', '', $sHost);
|
||||
}
|
||||
|
||||
return $sHost;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue