From fb9a3881fa85ffba2e64f06d7fa73d71fffc708c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 5 May 2026 13:40:41 +0200 Subject: [PATCH] Fix alert on blacklisted module when no message provided --- htdocs/admin/modules.php | 2 +- htdocs/core/modules/DolibarrModules.class.php | 13 ++++++++----- htdocs/langs/en_US/errors.lang | 2 +- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php index 8794797f3a1..d617a8ffa12 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -308,7 +308,7 @@ if ($action == 'install' && $allowonlineinstall) { } */ - // Check if module is in the remote malware list + // Check if module is in the remote malware blacklist (at URL DolibarrModules::URL_FOR_BLACKLISTED_MODULES) if (!$error) { if (GETPOST('checkforcompliance') == 'on') { try { diff --git a/htdocs/core/modules/DolibarrModules.class.php b/htdocs/core/modules/DolibarrModules.class.php index 376051cf4d4..fbf52b6eb02 100644 --- a/htdocs/core/modules/DolibarrModules.class.php +++ b/htdocs/core/modules/DolibarrModules.class.php @@ -2770,11 +2770,14 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it $arrayoflines = preg_split("/[\n,]/", $result['content']); foreach ($arrayoflines as $line) { $tmpfieldsofline = explode(';', $line); - $modulekey = strtolower($tmpfieldsofline[0]); - $conf->cache['noncompliantmodules'][$modulekey]['name'] = $tmpfieldsofline[0]; - $conf->cache['noncompliantmodules'][$modulekey]['id'] = (isset($tmpfieldsofline[1]) ? $tmpfieldsofline[1] : ''); - $conf->cache['noncompliantmodules'][$modulekey]['signature'] = (isset($tmpfieldsofline[2]) ? $tmpfieldsofline[2] : ''); - $conf->cache['noncompliantmodules'][$modulekey]['message'] = $langs->trans(empty($tmpfieldsofline[3]) ? 'WarningModuleAffiliatedToAReportedCompany' : $tmpfieldsofline[3]); + $modulekey = strtolower(trim($tmpfieldsofline[0])); + if (empty($modulekey)) { + continue; + } + $conf->cache['noncompliantmodules'][$modulekey]['name'] = trim($tmpfieldsofline[0]); + $conf->cache['noncompliantmodules'][$modulekey]['id'] = (isset($tmpfieldsofline[1]) ? trim($tmpfieldsofline[1]) : ''); + $conf->cache['noncompliantmodules'][$modulekey]['signature'] = (isset($tmpfieldsofline[2]) ? trim($tmpfieldsofline[2]) : ''); + $conf->cache['noncompliantmodules'][$modulekey]['message'] = $langs->trans(empty(isset($tmpfieldsofline[3]) ? trim($tmpfieldsofline[3]) : '') ? 'WarningModuleAffiliatedToAReportedCompany' : trim($tmpfieldsofline[3])); if (!empty($tmpfieldsofline[4])) { $message2 = $langs->trans("WarningModuleAffiliatedToAPiratPlatform", '{s}'); $listofillegalurl = ''; diff --git a/htdocs/langs/en_US/errors.lang b/htdocs/langs/en_US/errors.lang index 376be043648..b59a0a868af 100644 --- a/htdocs/langs/en_US/errors.lang +++ b/htdocs/langs/en_US/errors.lang @@ -431,7 +431,7 @@ WarningReadBankAlsoAllowedIfUserHasPermission=Warning, reading bank account is a WarningNoDataTransferedInAccountancyYet=Please note, there is no data in the accounting table. Please transfer your data recorded in the application to the accounting section or change the calculation mode to analyze the data recorded outside of accounting. WarningChangingThisMayBreakStopTaskScheduler=Warning, changing this value may disable the scheduler WarningAmountOfFileDiffersFromSumOfLines=Warning, amount of file (%s) differs from the sum of lines (%s) -WarningModuleAffiliatedToAReportedCompany=Warning, this module has been reported to the Dolibarr foundation as being published by a company using illegal practices (non-compliance with the rules for using the Dolibarr brand, collecting your data without your consent or deploying malware). +WarningModuleAffiliatedToAReportedCompany=Warning, this module has been reported to the Dolibarr foundation as being published by a company using illegal practices (non-compliance with the rules for using the Dolibarr brand, GPL license violation, collecting data without your consent OR deploying malware). WarningModuleAffiliatedToAPiratPlatform=Be careful when getting a module (paid or free) from a suspicious non official platform like %s WarningDNSServerNotAvailable=Warning, DNS server not available WarningSecureKeyNotSet=The value fo the securekey must not be empty