CardDAV (pre-release)

This commit is contained in:
RainLoop Team 2013-12-25 04:05:04 +04:00
parent 7a8fffede8
commit 639d8c58f6
38 changed files with 525 additions and 207 deletions

View file

@ -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;
}