Strip :port from HTTP_HOST when composing an absolute URL (#2444)

This commit is contained in:
Thomas Bruederli 2013-10-29 13:07:01 +01:00
parent 84e8e1a41d
commit 4cb0d62776

View file

@ -2273,7 +2273,7 @@ class calendar extends rcube_plugin
$schema = 'https';
$default_port = 443;
}
$url = $schema . '://' . $_SERVER['HTTP_HOST'];
$url = $schema . '://' . preg_replace('/:\d+$/', '', $_SERVER['HTTP_HOST']);
if ($_SERVER['SERVER_PORT'] != $default_port)
$url .= ':' . $_SERVER['SERVER_PORT'];
if (dirname($_SERVER['SCRIPT_NAME']) != '/')