Fix url for external links

This commit is contained in:
Nathan Gray 2012-05-08 15:10:43 +00:00
parent 1c6649a929
commit 2a24a4a53e

View File

@ -136,7 +136,19 @@ class filemanager_merge extends bo_merge
}
*/
$link = egw_link::mime_open($file['url'], $file['mime']);
// Prepend site
if(is_array($link))
{
// Directories have their internal protocol in path here
if($link['path'] && strpos($link['path'], '://') !== false) $link['path'] = $file['path'];
$link = egw_session::link('/index.php', $link);
}
else
{
// Regular files
$link = egw_session::link($link);
}
// Prepend site, if missing
if ($link{0} == '/')
{
$link = ($_SERVER['HTTPS'] || $GLOBALS['egw_info']['server']['enforce_ssl'] ? 'https://' : 'http://').