Use new core utility function to create valid absolute URLs (#3265).

ATTENTION: requires https://github.com/roundcube/roundcubemail/commit/06fdaf8
This commit is contained in:
Thomas Bruederli 2014-08-13 19:18:47 +02:00
parent befcf32baf
commit 31ee64d7e1

View file

@ -2778,21 +2778,7 @@ class calendar extends rcube_plugin
public function get_url($param = array())
{
$param += array('task' => 'calendar');
$schema = 'http';
$default_port = 80;
if (rcube_https_check()) {
$schema = 'https';
$default_port = 443;
}
$url = $schema . '://' . preg_replace('/:\d+$/', '', $_SERVER['HTTP_HOST']);
if ($_SERVER['SERVER_PORT'] != $default_port)
$url .= ':' . $_SERVER['SERVER_PORT'];
if (dirname($_SERVER['SCRIPT_NAME']) != '/')
$url .= dirname($_SERVER['SCRIPT_NAME']);
$url .= preg_replace('!^\./!', '/', $this->rc->url($param));
return $url;
return $this->rc->url($param, true, true);
}