Fix absolute paths when Roundcube is running at domain root

This commit is contained in:
Thomas Bruederli 2014-03-07 11:19:42 +01:00
parent e56bd6be79
commit 980f3db55c

View file

@ -122,10 +122,10 @@ class pdfviewer extends rcube_plugin
*/
private function abs_url($relpath = '')
{
$webroot = '';
$webroot = '/';
if (dirname($_SERVER['SCRIPT_NAME']) != '/')
$webroot .= dirname($_SERVER['SCRIPT_NAME']) . '/';
$webroot = dirname($_SERVER['SCRIPT_NAME']) . '/';
return $webroot . preg_replace('!^\./!', '', $relpath);
}