Fix bad include

This commit is contained in:
Laurent Destailleur 2022-01-18 15:27:43 +01:00
parent 642f77e8f5
commit 01aa2deae6

View File

@ -1585,7 +1585,7 @@ function top_htmlhead($head, $title = '', $disablejs = 0, $disablehead = 0, $arr
}
// cssfile is a relative path
$urlforcss = dol_buildpath($cssfile, 1);
if ($urlforcss) {
if ($urlforcss && $urlforcss != '/') {
print '<!-- Includes CSS added by module '.$modcss.' -->'."\n".'<link rel="stylesheet" type="text/css" href="'.$urlforcss;
// We add params only if page is not static, because some web server setup does not return content type text/css if url has parameters, so browser cache is not used.
if (!preg_match('/\.css$/i', $cssfile)) {
@ -1734,7 +1734,7 @@ function top_htmlhead($head, $title = '', $disablejs = 0, $disablehead = 0, $arr
foreach ($filesjs as $jsfile) {
// jsfile is a relative path
$urlforjs = dol_buildpath($jsfile, 1);
if ($urlforjs) {
if ($urlforjs && $urlforjs != '/') {
print '<!-- Include JS added by module '.$modjs.'-->'."\n".'<script src="'.$urlforjs.((strpos($jsfile, '?') === false) ? '?' : '&amp;').'lang='.$langs->defaultlang.'"></script>'."\n";
} else {
dol_syslog("Warning: module ".$modjs." declared a js path file for a file we can't find.", LOG_WARNING);