From 3d97888bc57192e8ed2e1b1140e7700f79840921 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 14 Jan 2022 17:46:06 +0100 Subject: [PATCH 1/2] Comment --- htdocs/core/lib/functions.lib.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 5f945db12ff..e891904e39e 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -807,6 +807,8 @@ function checkVal($out = '', $check = 'alphanohtml', $filter = null, $options = // No need to use a loop here, this step is not to sanitize (this is done at next step, this is to try to save chars, even if they are // using a non coventionnel way to be encoded, to not have them sanitized just after) $out = preg_replace_callback('/&#(x?[0-9][0-9a-f]+;?)/i', 'realCharForNumericEntities', $out); + //$out = preg_replace_callback('/&#(x?[0-9][0-9a-f]+;?)/i', function ($m) { return realCharForNumericEntities($m); }, $out); + // Now we remove all remaining HTML entities starting with a number. We don't want such entities. $out = preg_replace('/&#x?[0-9]+/i', '', $out); // For example if we have javascript with an entities without the ; to hide the 'a' of 'javascript'. From 8e4c7efed512a23dad0f16611d4bcd6fe43624a0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 15 Jan 2022 20:53:16 +0100 Subject: [PATCH 2/2] 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); + } } } }