From 8e4c7efed512a23dad0f16611d4bcd6fe43624a0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 15 Jan 2022 20:53:16 +0100 Subject: [PATCH] Fix do not include file if url not correctly detected --- htdocs/main.inc.php | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 9753f4b3d83..f62d1d71585 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -1584,12 +1584,17 @@ function top_htmlhead($head, $title = '', $disablejs = 0, $disablehead = 0, $arr dol_syslog("Warning: module ".$modcss." declared a css path file into its descriptor that is empty.", LOG_WARNING); } // cssfile is a relative path - print ''."\n".''."\n"; + } else { + dol_syslog("Warning: module ".$modcss." declared a css path file for a file we can't find.", LOG_WARNING); } - print '">'."\n"; } } } @@ -1728,7 +1733,12 @@ function top_htmlhead($head, $title = '', $disablejs = 0, $disablehead = 0, $arr $filesjs = (array) $filesjs; // To be sure filejs is an array foreach ($filesjs as $jsfile) { // jsfile is a relative path - print ''."\n".''."\n"; + $urlforjs = dol_buildpath($jsfile, 1); + if ($urlforjs) { + print ''."\n".''."\n"; + } else { + dol_syslog("Warning: module ".$modjs." declared a js path file for a file we can't find.", LOG_WARNING); + } } } }