Fix when alt path is full url instead of relative.

This commit is contained in:
Laurent Destailleur
2013-07-07 23:37:56 +02:00
parent 8f71e5fda2
commit b26250c45a

View File

@@ -287,8 +287,14 @@ function dol_buildpath($path, $type=0)
//print $key.'-'.$dirroot.'/'.$path.'-'.$conf->file->dol_url_root[$type].'<br>'."\n";
if (file_exists($dirroot.'/'.$path))
{
if ($type == 1) $res=DOL_URL_ROOT.$conf->file->dol_url_root[$key].'/'.$path;
if ($type == 2) $res=DOL_MAIN_URL_ROOT.$conf->file->dol_url_root[$key].'/'.$path;
if ($type == 1)
{
$res=(preg_match('/^http/i',$conf->file->dol_url_root[$key])?'':DOL_URL_ROOT).$conf->file->dol_url_root[$key].'/'.$path;
}
if ($type == 2)
{
$res=(preg_match('/^http/i',$conf->file->dol_url_root[$key])?'':DOL_MAIN_URL_ROOT).$conf->file->dol_url_root[$key].'/'.$path;
}
break;
}
}