From 24652ec722606273f18e5dcdd3a3d501a3a89ea4 Mon Sep 17 00:00:00 2001 From: Marc de Lima Lucio <68746600+marc-dll@users.noreply.github.com> Date: Sat, 2 Aug 2025 00:50:07 +0200 Subject: [PATCH 01/34] FIX: asset: could not select invoice in disposal pop-in (#34725) --- htdocs/asset/card.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/htdocs/asset/card.php b/htdocs/asset/card.php index bd3255491fc..643d46f63a0 100644 --- a/htdocs/asset/card.php +++ b/htdocs/asset/card.php @@ -271,9 +271,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $disposal_type_form = $object->showInputField(null, 'fk_disposal_type', $fk_disposal_type, '', '', '', 0); $object->fields['fk_disposal_type']['visible'] = -2; - $object->fields['disposal_invoice_id'] = array('type' => 'integer:Facture:compta/facture/class/facture.class.php::entity IN (__SHARED_ENTITIES__)', 'enabled' => '1', 'notnull' => 1, 'visible' => 1, 'index' => 1, 'validate' => '1',); - $disposal_invoice_form = $object->showInputField(null, 'disposal_invoice_id', $disposal_invoice_id, '', '', '', 0); - unset($object->fields['disposal_invoice_id']); + $disposal_invoice_form = $form->selectForForms('Facture:compta/facture/class/facture.class.php::(entity:IN:__SHARED_ENTITIES__)', 'disposal_invoice_id', $disposal_invoice_id); // Create an array for form $formquestion = array( From 1d61cd75f2a357e5696d575c32a9b7bef3110894 Mon Sep 17 00:00:00 2001 From: ldestailleur Date: Wed, 6 Aug 2025 19:39:58 +0200 Subject: [PATCH 02/34] Fix CI --- htdocs/core/lib/date.lib.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/core/lib/date.lib.php b/htdocs/core/lib/date.lib.php index ff9ce9215d3..aa0f4520a5e 100644 --- a/htdocs/core/lib/date.lib.php +++ b/htdocs/core/lib/date.lib.php @@ -1074,7 +1074,9 @@ function num_open_day($timestampStart, $timestampEnd, $inhour = 0, $lastday = 0, // Check if start/end days are working days just ONCE to optimize performance // by avoiding redundant calls to the potentially slow num_public_holiday() function. + // @phan-suppress-next-line PhanPluginSuspiciousParamPosition $isStartDayWorking = (num_public_holiday($timestampStart, $timestampStart, $country_code, 1) == 0); + // @phan-suppress-next-line PhanPluginSuspiciousParamPosition $isEndDayWorking = (num_public_holiday($timestampEnd, $timestampEnd, $country_code, 1) == 0); // Deduct 0.5 if the leave starts in the afternoon of a working day. From 91e88af806fa29656600b2d5a23afe73adb813d1 Mon Sep 17 00:00:00 2001 From: HENRY Florian Date: Wed, 6 Aug 2025 19:40:20 +0200 Subject: [PATCH 03/34] fix: backport fix PR #34833 for next version (#34884) --- htdocs/societe/document.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/societe/document.php b/htdocs/societe/document.php index abfa6495892..addf2ec2609 100644 --- a/htdocs/societe/document.php +++ b/htdocs/societe/document.php @@ -183,10 +183,11 @@ print ''; print dol_get_fiche_end(); -$modulepart = 'societe'; +$modulepart = 'company'; $permissiontoadd = $user->hasRight('societe', 'creer'); $permtoedit = $user->hasRight('societe', 'creer'); $param = '&id='.$object->id; +$relativepathwithnofile = $object->id . '/'; include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; // End of page From b3a22576382995077f5cbcf5f425828d2e3b4616 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Wed, 6 Aug 2025 21:22:47 +0200 Subject: [PATCH 04/34] Fix : contract line activation error when duration not defined (#34813) * Fix : contract line activation error when duration not defined * Fix of fix * Update card.php --------- Co-authored-by: x Co-authored-by: Laurent Destailleur --- htdocs/contrat/card.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index 6e5e32570f4..1656aed736b 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -1886,7 +1886,9 @@ if ($action == 'create') { if ($objp->fk_product > 0) { $product = new Product($db); $product->fetch($objp->fk_product); - $dateactend = dol_time_plus_duree(time(), $product->duration_value, $product->duration_unit); + if (!empty($product->duration_value) && !empty($product->duration_unit)) { + $dateactend = dol_time_plus_duree(time(), $product->duration_value, $product->duration_unit); + } } } From da56360404b9772b1e059eedcfbc264b84ea1687 Mon Sep 17 00:00:00 2001 From: Joachim Kueter Date: Thu, 7 Aug 2025 12:25:59 +0200 Subject: [PATCH 05/34] Fix for issue #34891 - wrong Skonto/Escompte calculation (#34892) When foreign currency is involved, the wrong total was used, mixing two currencies when calculating the sum. --- .../modules/supplier_invoice/doc/pdf_canelle.modules.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php b/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php index e466edf1deb..0b618907ee3 100644 --- a/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php +++ b/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php @@ -3,7 +3,8 @@ * Copyright (C) 2010-2014 Laurent Destailleur * Copyright (C) 2015 Marcos García * Copyright (C) 2018-2024 Frédéric France - * Copyright (C) 2024 MDW + * Copyright (C) 2024 MDW + * Copyright (C) 2025 Joachim Küter * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -804,7 +805,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("EscompteOfferedShort"), $useborder, 'L', 1); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($object->total_ttc - $deja_regle - $creditnoteamount - $depositsamount, 0, $outputlangs), $useborder, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($total_ttc - $deja_regle - $creditnoteamount - $depositsamount, 0, $outputlangs), $useborder, 'R', 1); $resteapayer = 0; } From 5024aee975e2a966e4385d0cf584cc5fe6236b19 Mon Sep 17 00:00:00 2001 From: HENRY Florian Date: Thu, 7 Aug 2025 14:42:20 +0200 Subject: [PATCH 06/34] fix: with MAIN_MAIL_ADD_INLINE_IMAGES_IF_IN_MEDIAS and multicompany image are not find on send mail (#34894) --- htdocs/core/class/CMailFile.class.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/CMailFile.class.php b/htdocs/core/class/CMailFile.class.php index e41fa2d0ca5..e1a90982b20 100644 --- a/htdocs/core/class/CMailFile.class.php +++ b/htdocs/core/class/CMailFile.class.php @@ -269,7 +269,11 @@ class CMailFile // Note because media links are public, this should be useless, except avoid blocking images with email browser. // This convert an embedd file with src="/viewimage.php?modulepart... into a cid link // TODO Exclude viewimage used for the read tracker ? - $findimg = $this->findHtmlImages($dolibarr_main_data_root.'/medias'); + $dolibarr_main_data_root_images=$dolibarr_main_data_root; + if ($conf->entity!==1) { + $dolibarr_main_data_root_images.='/'.$conf->entity.'/'; + } + $findimg = $this->findHtmlImages($dolibarr_main_data_root_images.'/medias'); if ($findimg<0) { dol_syslog("CMailFile::CMailfile: Error on findHtmlImages"); $this->error = 'ErrorInAddAttachementsImageBaseOnMedia'; From 9666a96d8ce326f4f886aa0c38ceda8b312765d8 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sat, 9 Aug 2025 15:19:02 +0200 Subject: [PATCH 07/34] FIX #34893 (#34897) * FIX #34893 * FIX change error code to USERNOTALLOWEDTOCHANGEPASS --- htdocs/user/passwordforgotten.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/htdocs/user/passwordforgotten.php b/htdocs/user/passwordforgotten.php index 2a711208e8b..93ba11c26c5 100644 --- a/htdocs/user/passwordforgotten.php +++ b/htdocs/user/passwordforgotten.php @@ -131,6 +131,15 @@ if (empty($reshook)) { $result = $edituser->fetch('', '', '', 1, $conf->entity, $username); } + // If the user does not have the right to change his own password + if ($result > 0) { + $edituser->getrights('user'); + if (!$edituser->hasRight('user', 'self', 'password')) { + $result = 0; + $edituser->error = 'USERNOTALLOWEDTOCHANGEPASS'; + } + } + // Set the message to show (must be the same if login/email exists or not // to avoid to guess them. $messagewarning = ''; - if ($result <= 0 && $edituser->error == 'USERNOTFOUND') { + if ($result <= 0 && ($edituser->error == 'USERNOTFOUND' || $edituser->error == 'USERNOTALLOWEDTOCHANGEPASS')) { usleep(20000); // add delay to simulate setPassword() and send_password() actions delay (0.02s) $message .= $messagewarning; $username = ''; From a9c07569fb30a2212b122e0034b0822b90b38eb2 Mon Sep 17 00:00:00 2001 From: ldestailleur Date: Tue, 12 Aug 2025 13:26:52 +0200 Subject: [PATCH 08/34] FIX Logo on company is no more visible. --- htdocs/core/lib/functions.lib.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index a3000cdf430..8fccd4f1dd7 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -7715,7 +7715,6 @@ function get_exdir($num, $level, $alpha, $withoutslash, $object, $modulepart = ' if (empty($level) && array_key_exists($modulepart, $arrayforoldpath)) { $level = $arrayforoldpath[$modulepart]; } - if (!empty($level) && array_key_exists($modulepart, $arrayforoldpath)) { // This part should be removed once all code is using "get_exdir" to forge path, with parameter $object and $modulepart provided. if (empty($num) && is_object($object)) { @@ -7740,8 +7739,12 @@ function get_exdir($num, $level, $alpha, $withoutslash, $object, $modulepart = ' // We will enhance here a common way of forging path for document storage. // In a future, we may distribute directories on several levels depending on setup and object. // Here, $object->id, $object->ref and $modulepart are required. - //var_dump($modulepart); - $path = dol_sanitizeFileName(empty($object->ref) ? (string) ((is_object($object) && property_exists($object, 'id')) ? $object->id : '') : $object->ref); + if (in_array($modulepart, array('societe', 'thirdparty')) && $object instanceOf Societe) { + // Special case for thirdparty, where the ref is a company name that is not unique so path on disk is using the ID instead of the ref + $path = dol_sanitizeFileName($object->id); + } else { + $path = dol_sanitizeFileName(empty($object->ref) ? (string) ((is_object($object) && property_exists($object, 'id')) ? $object->id : '') : $object->ref); + } } if (empty($withoutslash) && !empty($path)) { From e3953f684b20c870fa0708747e07a0a10f6dc35a Mon Sep 17 00:00:00 2001 From: HENRY Florian Date: Thu, 14 Aug 2025 19:03:37 +0200 Subject: [PATCH 09/34] fix: with MAIN_MAIL_ADD_INLINE_IMAGES_IF_IN_MEDIAS and multicompany image are not find on send mail (#34946) --- htdocs/core/class/CMailFile.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/CMailFile.class.php b/htdocs/core/class/CMailFile.class.php index e1a90982b20..3050bf3cd63 100644 --- a/htdocs/core/class/CMailFile.class.php +++ b/htdocs/core/class/CMailFile.class.php @@ -270,7 +270,7 @@ class CMailFile // This convert an embedd file with src="/viewimage.php?modulepart... into a cid link // TODO Exclude viewimage used for the read tracker ? $dolibarr_main_data_root_images=$dolibarr_main_data_root; - if ($conf->entity!==1) { + if ((int)$conf->entity!==1) { $dolibarr_main_data_root_images.='/'.$conf->entity.'/'; } $findimg = $this->findHtmlImages($dolibarr_main_data_root_images.'/medias'); From 3362a6b06d8b212c78235a7ff5d3c2b06127677f Mon Sep 17 00:00:00 2001 From: lvessiller-opendsi Date: Wed, 20 Aug 2025 19:03:18 +0200 Subject: [PATCH 10/34] FIX The combo of custom groups has disappeared (backport v19) (#35016) --- htdocs/accountancy/admin/categories.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/accountancy/admin/categories.php b/htdocs/accountancy/admin/categories.php index 4ef7fe78726..014de28bcf3 100644 --- a/htdocs/accountancy/admin/categories.php +++ b/htdocs/accountancy/admin/categories.php @@ -135,6 +135,7 @@ $s = $formaccounting->select_accounting_category($cat_id, 'account_category', 1, if ($formaccounting->nbaccounts_category <= 0) { print ''.$s.''; } else { + print $s; print ''; } print ''; From a8d4067af26f4407741d1d444a8dcc38e414c2f1 Mon Sep 17 00:00:00 2001 From: Benjamin Chanudet Date: Fri, 22 Aug 2025 05:18:25 +0200 Subject: [PATCH 11/34] FIX #35011 Computed extrafield on tasks list now display correct values (#35038) The functions assigns value to `$obj` on line 976, but doesn't assign value to `$object`, that is then assigned to `$objectoffield` in line 75 of `extrafields_list_print_fields.tpl.php`. Also `$objectoffield` is the recommended value to use for computed extrafields, according to the docs. But assigning `$object` is not enough, because `$objectoffield` at this moment is not grabbed from the global scope, so the value stays local and `dol_eval()` doesn't find it. So it also needs to grab the variable from the global scope to affect it correctly. The changed function, `projectLinesa()` is called only twice in the project: by itself recursively to go through all subtasks, and on the page where I detected the bug initially, `tasks.php`, so the impact should be minimal. --- htdocs/core/lib/project.lib.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php index 23ae5d8b032..931fd08680b 100644 --- a/htdocs/core/lib/project.lib.php +++ b/htdocs/core/lib/project.lib.php @@ -600,6 +600,7 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t { global $user, $langs, $conf, $db, $hookmanager; global $projectstatic, $taskstatic, $extrafields; + global $objectoffield; $lastprojectid = 0; @@ -936,6 +937,7 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t $extrafieldsobjectkey = $taskstatic->table_element; $extrafieldsobjectprefix = 'efpt.'; $obj = $lines[$i]; + $object = $lines[$i]; include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php'; // Fields from hook $parameters = array('arrayfields' => $arrayfields, 'obj' => $lines[$i]); From 381c6fbecfaced84e6854416d5edd1ef70d1c08d Mon Sep 17 00:00:00 2001 From: ldestailleur Date: Sun, 24 Aug 2025 22:05:46 +0200 Subject: [PATCH 12/34] Fix CI --- htdocs/core/class/CMailFile.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/CMailFile.class.php b/htdocs/core/class/CMailFile.class.php index 3050bf3cd63..8f4e0f420f7 100644 --- a/htdocs/core/class/CMailFile.class.php +++ b/htdocs/core/class/CMailFile.class.php @@ -270,11 +270,11 @@ class CMailFile // This convert an embedd file with src="/viewimage.php?modulepart... into a cid link // TODO Exclude viewimage used for the read tracker ? $dolibarr_main_data_root_images=$dolibarr_main_data_root; - if ((int)$conf->entity!==1) { + if ((int) $conf->entity !== 1) { $dolibarr_main_data_root_images.='/'.$conf->entity.'/'; } $findimg = $this->findHtmlImages($dolibarr_main_data_root_images.'/medias'); - if ($findimg<0) { + if ($findimg < 0) { dol_syslog("CMailFile::CMailfile: Error on findHtmlImages"); $this->error = 'ErrorInAddAttachementsImageBaseOnMedia'; return; From 07512d1dadb10f74323d3ab72b2ecba9ee319e1e Mon Sep 17 00:00:00 2001 From: kkhelifa-opendsi Date: Wed, 27 Aug 2025 03:06:19 +0200 Subject: [PATCH 13/34] FIX - Fix missing token for disable custom group category for compta report (page /htdocs/accountancy/admin/categories_list.php) (#35084) --- htdocs/accountancy/admin/categories_list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/accountancy/admin/categories_list.php b/htdocs/accountancy/admin/categories_list.php index 16dbba074a2..3706a6f5d5b 100644 --- a/htdocs/accountancy/admin/categories_list.php +++ b/htdocs/accountancy/admin/categories_list.php @@ -896,7 +896,7 @@ if ($resql) { // Active print ''; if ($canbedisabled) { - print ''.$actl[$obj->active].''; + print ''.$actl[$obj->active].''; } else { print $langs->trans("AlwaysActive"); } From 1f29c7758c3b235531c647f740f2103cf5af4e4f Mon Sep 17 00:00:00 2001 From: Marc de Lima Lucio <68746600+marc-dll@users.noreply.github.com> Date: Wed, 27 Aug 2025 11:30:26 +0200 Subject: [PATCH 14/34] FIX: accountancy general ledger: bad handling of hook return (#34029) * FIX: accountancy general ledger: bad handling of hook return * FIX: accountancy balance: bad handling of hook return --- htdocs/accountancy/bookkeeping/balance.php | 2 +- htdocs/accountancy/bookkeeping/listbyaccount.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/accountancy/bookkeeping/balance.php b/htdocs/accountancy/bookkeeping/balance.php index 2d0642c9642..ee006db56b9 100644 --- a/htdocs/accountancy/bookkeeping/balance.php +++ b/htdocs/accountancy/bookkeeping/balance.php @@ -303,7 +303,7 @@ if ($action != 'export_csv') { $newcardbutton = empty($hookmanager->resPrint) ? '' : $hookmanager->resPrint; if (empty($reshook)) { - $newcardbutton = 'global->ACCOUNTING_EXPORT_FORMAT.')" />'; + $newcardbutton .= 'global->ACCOUNTING_EXPORT_FORMAT.')" />'; print ' +SCRIPT; + exit; + } +} /** * Abort invoice creationg with a given error message From e3abe90ee0a1a88a94e87a223c7ab9b80055721f Mon Sep 17 00:00:00 2001 From: ldestailleur Date: Wed, 3 Sep 2025 19:19:49 +0200 Subject: [PATCH 22/34] FIX Restore decimal quantity for stock correction/transfer --- htdocs/product/stock/movement_list.php | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/htdocs/product/stock/movement_list.php b/htdocs/product/stock/movement_list.php index 4653864a5ba..9f2cb1d1209 100644 --- a/htdocs/product/stock/movement_list.php +++ b/htdocs/product/stock/movement_list.php @@ -358,7 +358,7 @@ if ($action == "correct_stock" && $permissiontoadd) { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Product")), null, 'errors'); $action = 'correction'; } - if (!is_numeric(GETPOST("nbpiece"))) { + if (!GETPOSTFLOAT("nbpiece")) { $error++; setEventMessages($langs->trans("ErrorFieldMustBeANumeric", $langs->transnoentitiesnoconv("NumberOfUnit")), null, 'errors'); $action = 'correction'; @@ -384,7 +384,7 @@ if ($action == "correct_stock" && $permissiontoadd) { $result = $product->correct_stock_batch( $user, $id, - GETPOSTINT("nbpiece"), + GETPOSTFLOAT("nbpiece"), GETPOSTINT("mouvement"), GETPOST("label", 'alphanohtml'), price2num(GETPOST('unitprice'), 'MT'), @@ -401,7 +401,7 @@ if ($action == "correct_stock" && $permissiontoadd) { $result = $product->correct_stock( $user, $id, - GETPOSTINT("nbpiece"), + GETPOSTFLOAT("nbpiece"), GETPOSTINT("mouvement"), GETPOST("label", 'alphanohtml'), price2num(GETPOST('unitprice'), 'MT'), @@ -446,7 +446,7 @@ if ($action == "transfert_stock" && $permissiontoadd && !$cancel) { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Product")), null, 'errors'); $action = 'transfert'; } - if (!GETPOSTINT("nbpiece")) { + if (!GETPOSTFLOAT("nbpiece")) { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("NumberOfUnit")), null, 'errors'); $error++; $action = 'transfert'; @@ -510,7 +510,7 @@ if ($action == "transfert_stock" && $permissiontoadd && !$cancel) { $result1 = $product->correct_stock_batch( $user, $srcwarehouseid, - GETPOSTINT("nbpiece"), + GETPOSTFLOAT("nbpiece"), 1, GETPOST("label", 'san_alpha'), $pricesrc, @@ -527,7 +527,7 @@ if ($action == "transfert_stock" && $permissiontoadd && !$cancel) { $result2 = $product->correct_stock_batch( $user, GETPOSTINT("id_entrepot_destination"), - GETPOSTINT("nbpiece"), + GETPOSTFLOAT("nbpiece"), 0, GETPOST("label", 'san_alpha'), $pricedest, @@ -546,9 +546,9 @@ if ($action == "transfert_stock" && $permissiontoadd && !$cancel) { $result1 = $product->correct_stock( $user, $id, - GETPOST("nbpiece"), + GETPOSTFLOAT("nbpiece"), 1, - GETPOST("label", 'san_alpha'), + GETPOST("label", 'alphanohtml'), $pricesrc, GETPOST('inventorycode', 'alphanohtml'), '', @@ -561,9 +561,9 @@ if ($action == "transfert_stock" && $permissiontoadd && !$cancel) { $result2 = $product->correct_stock( $user, GETPOST("id_entrepot_destination"), - GETPOST("nbpiece"), + GETPOSTFLOAT("nbpiece"), 0, - GETPOST("label", 'san_alpha'), + GETPOST("label", 'alphanohtml'), $pricedest, GETPOST('inventorycode', 'alphanohtml'), '', From b05be5e1df570483cd47b6ef0e1ad0d684257440 Mon Sep 17 00:00:00 2001 From: Sylvain Legrand Date: Thu, 4 Sep 2025 13:01:26 +0300 Subject: [PATCH 23/34] Fix discount applied 2 times on contract (#35219) on update line the discount was apply 2 times ! no problem on insert line. Already solved on v22 --- htdocs/contrat/card.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index c20651a2488..79238cd486e 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -756,10 +756,11 @@ if (empty($reshook)) { $price_ht = price2num(GETPOST('elprice'), 'MU'); $remise_percent = price2num(GETPOST('elremise_percent'), 2); - if ($remise_percent > 0) { + // Discount applied 2 times => see line 803 + /*if ($remise_percent > 0) { $remise = round(($price_ht * $remise_percent / 100), 2); $price_ht = ($price_ht - $remise); - } + }*/ $objectline->fk_product = GETPOST('idprod', 'int'); $objectline->description = GETPOST('product_desc', 'restricthtml'); From c6b62915f6864c1ca45a81145049e32689dab383 Mon Sep 17 00:00:00 2001 From: bohdanpotuzhnyi <72936384+bohdanpotuzhnyi@users.noreply.github.com> Date: Thu, 4 Sep 2025 13:26:47 +0200 Subject: [PATCH 24/34] support RFC5789 (patch) (#35213) --- htdocs/core/lib/geturl.lib.php | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/htdocs/core/lib/geturl.lib.php b/htdocs/core/lib/geturl.lib.php index 7eb5d57d502..bbd21393fa6 100644 --- a/htdocs/core/lib/geturl.lib.php +++ b/htdocs/core/lib/geturl.lib.php @@ -30,7 +30,7 @@ * - common local lookup ips like 127.*.*.* are automatically added * * @param string $url URL to call. - * @param string $postorget 'POST', 'GET', 'HEAD', 'PUT', 'PUTALREADYFORMATED', 'POSTALREADYFORMATED', 'DELETE' + * @param string $postorget 'POST', 'GET', 'HEAD', 'PUT', 'PATCH', 'PUTALREADYFORMATED', 'POSTALREADYFORMATED', 'PATCHALREADYFORMATED', 'DELETE' * @param string $param Parameters of URL (x=value1&y=value2) or may be a formatted content with $postorget='PUTALREADYFORMATED' * @param integer $followlocation 0=Do not follow, 1=Follow location. * @param string[] $addheaders Array of string to add into header. Example: ('Accept: application/xrds+xml', ....) @@ -144,6 +144,19 @@ function getURLContent($url, $postorget = 'GET', $param = '', $followlocation = } elseif ($postorget == 'PUTALREADYFORMATED') { curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT'); // HTTP request is 'PUT' curl_setopt($ch, CURLOPT_POSTFIELDS, $param); // param = content of post, like a xml string + } elseif ($postorget == 'PATCH') { + $array_param = null; + curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PATCH'); // RFC 5789 + if (!is_array($param)) { + parse_str($param, $array_param); + } else { + dol_syslog("parameter param must be a string", LOG_WARNING); + $array_param = $param; + } + curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($array_param)); + } elseif ($postorget == 'PATCHALREADYFORMATED') { + curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PATCH'); // RFC 5789 + curl_setopt($ch, CURLOPT_POSTFIELDS, $param); } elseif ($postorget == 'HEAD') { curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'HEAD'); // HTTP request is 'HEAD' curl_setopt($ch, CURLOPT_NOBODY, true); From a69ba88857138c0707a8830c35055539c597e18d Mon Sep 17 00:00:00 2001 From: kkhelifa-opendsi Date: Thu, 4 Sep 2025 13:27:49 +0200 Subject: [PATCH 25/34] FIX: Correct the calculation of the amount of the current period between the period provided (#35083) --- htdocs/compta/resultat/result.php | 52 +++++++++++++++++-------------- 1 file changed, 28 insertions(+), 24 deletions(-) diff --git a/htdocs/compta/resultat/result.php b/htdocs/compta/resultat/result.php index 0634c8bdac2..94266434b35 100644 --- a/htdocs/compta/resultat/result.php +++ b/htdocs/compta/resultat/result.php @@ -505,33 +505,37 @@ if ($modecompta == 'CREANCES-DETTES') { $yeartoprocess++; } - //var_dump($monthtoprocess.'_'.$yeartoprocess); - if (isset($cpt['account_number'])) { - $return = $AccCat->getSumDebitCredit($cpt['account_number'], $date_start, $date_end, empty($cat['dc']) ? 0 : $cat['dc'], 'nofilter', $monthtoprocess, $yeartoprocess); - if ($return < 0) { - setEventMessages(null, $AccCat->errors, 'errors'); - $resultM = 0; + if (($yeartoprocess == $start_year && ($k + 1) >= $date_startmonth && $k < $date_endmonth) || + ($yeartoprocess == $start_year + 1 && ($k + 1) < $date_startmonth) + ) { + //var_dump($monthtoprocess.'_'.$yeartoprocess); + if (isset($cpt['account_number'])) { + $return = $AccCat->getSumDebitCredit($cpt['account_number'], $date_start, $date_end, empty($cat['dc']) ? 0 : $cat['dc'], 'nofilter', $monthtoprocess, $yeartoprocess); + if ($return < 0) { + setEventMessages(null, $AccCat->errors, 'errors'); + $resultM = 0; + } else { + $resultM = $AccCat->sdc; + } } else { - $resultM = $AccCat->sdc; + $resultM = 0; + } + if (empty($totCat['M'][$k])) { + $totCat['M'][$k] = $resultM; + } else { + $totCat['M'][$k] += $resultM; + } + if (empty($sommes[$code]['M'][$k])) { + $sommes[$code]['M'][$k] = $resultM; + } else { + $sommes[$code]['M'][$k] += $resultM; + } + if (isset($cpt['account_number'])) { + $totPerAccount[$cpt['account_number']]['M'][$k] = $resultM; } - } else { - $resultM = 0; - } - if (empty($totCat['M'][$k])) { - $totCat['M'][$k] = $resultM; - } else { - $totCat['M'][$k] += $resultM; - } - if (empty($sommes[$code]['M'][$k])) { - $sommes[$code]['M'][$k] = $resultM; - } else { - $sommes[$code]['M'][$k] += $resultM; - } - if (isset($cpt['account_number'])) { - $totPerAccount[$cpt['account_number']]['M'][$k] = $resultM; - } - $resultN += $resultM; + $resultN += $resultM; + } } if (empty($totCat)) { From 96a74c4976725ced40bac1448b6b1484a424d60e Mon Sep 17 00:00:00 2001 From: ldestailleur Date: Thu, 4 Sep 2025 14:13:13 +0200 Subject: [PATCH 26/34] Disable this test where result is not predicable --- test/phpunit/SecurityTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/phpunit/SecurityTest.php b/test/phpunit/SecurityTest.php index e34144c1c51..3c9015d7f95 100644 --- a/test/phpunit/SecurityTest.php +++ b/test/phpunit/SecurityTest.php @@ -581,7 +581,7 @@ class SecurityTest extends PHPUnit\Framework\TestCase $result=GETPOST("param15", 'restricthtml'); // param15 = src=>0xbeefed that is a dangerous string print __METHOD__." result=".$result."\n"; - $this->assertEquals('InvalidHTMLStringCantBeCleaned', $result, 'Test 15b'); // With some PHP and libxml version, we got this result when parsing invalid HTML, but ... + //$this->assertEquals('InvalidHTMLStringCantBeCleaned', $result, 'Test 15b'); // With some PHP and libxml version, we got this result when parsing invalid HTML, but ... //$this->assertEquals(' src=>0xbeefed', $result, 'Test 15b'); // ... on other PHP and libxml versions, we got a HTML that has been cleaned From 75ee26c3edfe376d84c42c6e9412ff5790547027 Mon Sep 17 00:00:00 2001 From: VIAL-GOUTEYRON Quentin Date: Thu, 4 Sep 2025 14:26:42 +0200 Subject: [PATCH 27/34] Add HRM module support in `dol_check_secure_access_document()` function to manage file access rights. (#35218) * Add HRM module support in `dol_check_secure_access_document()` function to manage file access rights. * fix space * Update files.lib.php --------- Co-authored-by: Laurent Destailleur --- htdocs/core/lib/files.lib.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index d2556b2c5c0..4e18a81e023 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -3184,6 +3184,10 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity, // Wrapping for recruitment module $accessallowed = $user->hasRight('recruitment', 'recruitmentjobposition', 'read'); $original_file = $conf->recruitment->dir_output.'/'.$original_file; + } elseif ($modulepart == 'hrm' && !empty($conf->hrm->dir_output)) { + // Wrapping for hrm module + $accessallowed = $user->hasRight('hrm', 'all', 'read'); + $original_file = $conf->hrm->dir_output.'/'.$original_file; } elseif ($modulepart == 'editor' && !empty($conf->fckeditor->dir_output)) { // Wrapping for wysiwyg editor $accessallowed = 1; From 9e2e6eea92247dffbe77aab028dd1ef3a91d8ca0 Mon Sep 17 00:00:00 2001 From: ldestailleur Date: Thu, 4 Sep 2025 14:35:02 +0200 Subject: [PATCH 28/34] Fix warning --- htdocs/core/lib/geturl.lib.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/geturl.lib.php b/htdocs/core/lib/geturl.lib.php index bbd21393fa6..124922c03f8 100644 --- a/htdocs/core/lib/geturl.lib.php +++ b/htdocs/core/lib/geturl.lib.php @@ -135,7 +135,7 @@ function getURLContent($url, $postorget = 'GET', $param = '', $followlocation = $array_param = null; curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT'); // HTTP request is 'PUT' if (!is_array($param)) { - parse_str($param, $array_param); + parse_str($param, $array_param); // @phan-suppress-current-line PhanPluginConstantVariableNull } else { dol_syslog("parameter param must be a string", LOG_WARNING); $array_param = $param; @@ -148,7 +148,7 @@ function getURLContent($url, $postorget = 'GET', $param = '', $followlocation = $array_param = null; curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PATCH'); // RFC 5789 if (!is_array($param)) { - parse_str($param, $array_param); + parse_str($param, $array_param); // @phan-suppress-current-line PhanPluginConstantVariableNull } else { dol_syslog("parameter param must be a string", LOG_WARNING); $array_param = $param; From 01aa901f935fa6fa12e6682681470fcdf814523e Mon Sep 17 00:00:00 2001 From: ThomasNgr-OpenDSI Date: Thu, 4 Sep 2025 14:59:44 +0200 Subject: [PATCH 29/34] 18.0 fix CVE 2024 40137 (#34762) * Sec: Remove all functions that accept callable params - CVE-2024-40137 * FIX #34746 - More complete fix for CVE-2024-40137 --------- Co-authored-by: ldestailleur --- htdocs/core/lib/functions.lib.php | 81 +++++++++++++++++++++++++------ htdocs/install/upgrade.php | 10 ++++ htdocs/install/upgrade2.php | 55 +++++++++++++++++++-- test/phpunit/.gitignore | 1 + test/phpunit/SecurityTest.php | 19 +++++++- 5 files changed, 145 insertions(+), 21 deletions(-) create mode 100644 test/phpunit/.gitignore diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 4be573045c8..3de8219199a 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -7251,8 +7251,23 @@ function dol_string_onlythesehtmltags($stringtoclean, $cleanalsosomestyles = 1, */ function dol_string_onlythesehtmlattributes($stringtoclean, $allowed_attributes = array("allow", "allowfullscreen", "alt", "class", "contenteditable", "data-html", "frameborder", "height", "href", "id", "name", "src", "style", "target", "title", "width")) { + if (is_null($allowed_attributes)) { + $allowed_attributes = array( + "allow", "allowfullscreen", "alt", "async", "class", "contenteditable", "crossorigin", "data-html", "frameborder", "height", "href", "id", "name", "property", "rel", "src", "style", "target", "title", "type", "width", + // HTML5 + "header", "footer", "nav", "section", "menu", "menuitem" + ); + } + // Always add content and http-equiv for meta tags, required to force encoding and keep html content in utf8 by load/saveHTML functions. + if (!in_array("content", $allowed_attributes)) { + $allowed_attributes[] = "content"; + } + if (!in_array("http-equiv", $allowed_attributes)) { + $allowed_attributes[] = "http-equiv"; + } + if (class_exists('DOMDocument') && !empty($stringtoclean)) { - $stringtoclean = ''.$stringtoclean.''; + $stringtoclean = ''.$stringtoclean.''; $dom = new DOMDocument(null, 'UTF-8'); $dom->loadHTML($stringtoclean, LIBXML_ERR_NONE|LIBXML_HTML_NOIMPLIED|LIBXML_HTML_NODEFDTD|LIBXML_NONET|LIBXML_NOWARNING|LIBXML_NOXMLDECL); @@ -7293,12 +7308,15 @@ function dol_string_onlythesehtmlattributes($stringtoclean, $allowed_attributes } } + $dom->encoding = 'UTF-8'; + $return = $dom->saveHTML(); // This may add a LF at end of lines, so we will trim later //$return = 'aaaa

bb

ssdd

'."\n

aaa

aa

bb

"; $return = preg_replace('/^'.preg_quote('', '/').'/', '', $return); - $return = preg_replace('/^'.preg_quote('', '/').'/', '', $return); - $return = preg_replace('/'.preg_quote('', '/').'$/', '', $return); + $return = preg_replace('/^'.preg_quote('<', '/').'[^<>]*'.preg_quote('>', '/').'/', '', $return); + $return = preg_replace('/'.preg_quote('', '/').'$/', '', trim($return)); + return trim($return); } else { return $stringtoclean; @@ -7448,13 +7466,26 @@ function dol_htmlwithnojs($stringtoencode, $nouseofiframesandbox = 0, $check = ' // Add a trick to solve pb with text without parent tag // like '

Foo

bar

' that wrongly ends up, without the trick, with '

Foo

bar

' // like 'abc' that wrongly ends up, without the trick, with '

abc

' - $out = '
'.$out.'
'; - $dom->loadHTML($out, LIBXML_HTML_NODEFDTD|LIBXML_ERR_NONE|LIBXML_HTML_NOIMPLIED|LIBXML_NONET|LIBXML_NOWARNING|LIBXML_NOXMLDECL); + + if (dol_textishtml($out)) { + $out = '
'.$out.'
'; + } else { + $out = '
'.dol_nl2br($out).'
'; + } + + $dom->loadHTML($out, LIBXML_HTML_NODEFDTD | LIBXML_ERR_NONE | LIBXML_HTML_NOIMPLIED | LIBXML_NONET | LIBXML_NOWARNING | LIBXML_NOERROR | LIBXML_NOXMLDECL); + + $dom->encoding = 'UTF-8'; + $out = trim($dom->saveHTML()); - // Remove the trick added to solve pb with text without parent tag - $out = preg_replace('/^
/', '', $out); - $out = preg_replace('/<\/div>$/', '', $out); + // Remove the trick added to solve pb with text in utf8 and text without parent tag + $out = preg_replace('/^'.preg_quote('', '/').'/', '', $out); + $out = preg_replace('/^'.preg_quote('<', '/').'[^<>]+'.preg_quote('>
', '/').'/', '', $out); + $out = preg_replace('/'.preg_quote('
', '/').'$/', '', trim($out)); + // $out = preg_replace('/^<\?xml encoding="UTF-8">
/', '', $out); + // $out = preg_replace('/<\/div>$/', '', $out); + // var_dump('rrrrrrrrrrrrrrrrrrrrrrrrrrrrr'.$out); } catch (Exception $e) { // If error, invalid HTML string with no way to clean it //print $e->getMessage(); @@ -7492,7 +7523,7 @@ function dol_htmlwithnojs($stringtoencode, $nouseofiframesandbox = 0, $check = ' } while ($oldstringtoclean != $out); // Check the limit of external links that are automatically executed in a Rich text content. We count: - // ' + // ', we can only accept " $reg = array(); @@ -9228,7 +9259,7 @@ function verifCond($strToEvaluate) /** * Replace eval function to add more security. - * This function is called by verifCond() or trans() and transnoentitiesnoconv(). + * This function is called by verifCond() for example. * * @param string $s String to evaluate * @param int $returnvalue 0=No return (used to execute eval($a=something)). 1=Value of eval is returned (used to eval($something)). @@ -9319,14 +9350,32 @@ function dol_eval($s, $returnvalue = 0, $hideerrors = 1, $onlysimplestring = '1' $forbiddenphpstrings = array('$$'); $forbiddenphpstrings = array_merge($forbiddenphpstrings, array('_ENV', '_SESSION', '_COOKIE', '_GET', '_POST', '_REQUEST', 'ReflectionFunction')); - $forbiddenphpfunctions = array("exec", "passthru", "shell_exec", "system", "proc_open", "popen"); - $forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("dol_eval", "executeCLI", "verifCond")); // native dolibarr functions - $forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("base64_decode", "rawurldecode", "urldecode", "str_rot13", "hex2bin")); // decode string functions used to obfuscated function name - $forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("fopen", "file_put_contents", "fputs", "fputscsv", "fwrite", "fpassthru", "require", "include", "mkdir", "rmdir", "symlink", "touch", "unlink", "umask")); + // We list all forbidden function as keywords we don't want to see (we don't mind it if is "kewyord(" or just "keyword", we don't want "keyword" at all) + // We must exclude all functions that allow to execute another function. This includes all function that has a parameter with type "callable" to avoid things + // like we can do with array_map and its callable parameter: dol_eval('json_encode(array_map(implode("",["ex","ec"]), ["id"]))', 1, 1, '0') + $forbiddenphpfunctions = array(); + // @phpcs:ignore + $forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("base64"."_"."decode", "rawurl"."decode", "url"."decode", "str"."_rot13", "hex"."2bin")); // name of forbidden functions are split to avoid false positive + $forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("override_function", "session_id", "session_create_id", "session_regenerate_id")); $forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("get_defined_functions", "get_defined_vars", "get_defined_constants", "get_declared_classes")); - $forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("function", "call_user_func")); + $forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("function", "call_user_func", "call_user_func_array")); + + $forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("array_all", "array_any", "array_diff_ukey", "array_filter", "array_find", "array_find_key", "array_map", "array_reduce", "array_intersect_uassoc", "array_intersect_ukey", "array_walk", "array_walk_recursive")); + $forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("usort", "uasort", "uksort", "preg_replace_callback", "preg_replace_callback_array", "header_register_callback")); + $forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("set_error_handler", "set_exception_handler", "libxml_set_external_entity_loader", "register_shutdown_function", "register_tick_function", "unregister_tick_function")); + $forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("spl_autoload_register", "spl_autoload_unregister", "iterator_apply", "session_set_save_handler")); + $forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("forward_static_call", "forward_static_call_array", "register_postsend_function")); + + $forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("ob_start")); + $forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("require", "include", "require_once", "include_once")); - $forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("eval", "create_function", "assert", "mb_ereg_replace")); // function with eval capabilities + $forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("exec", "passthru", "shell_exec", "system", "proc_open", "popen")); + $forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("dol_eval", "executeCLI", "verifCond")); // native dolibarr functions + $forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("eval", "create_function", "assert", "mb_ereg_replace", "mb_ereg_replace_callback")); // function with eval capabilities + $forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("readline_completion_function", "readline_callback_handler_install")); + $forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("dol_compress_dir", "dol_decode", "dol_delete_file", "dol_delete_dir", "dol_delete_dir_recursive", "dol_copy", "archiveOrBackupFile")); // more dolibarr functions + $forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("fopen", "file_put_contents", "fputs", "fputscsv", "fwrite", "fpassthru", "mkdir", "rmdir", "symlink", "touch", "unlink", "umask")); + $forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("require", "include")); $forbiddenphpmethods = array('invoke', 'invokeArgs'); // Method of ReflectionFunction to execute a function diff --git a/htdocs/install/upgrade.php b/htdocs/install/upgrade.php index 0a0c2d63219..9299c2623bb 100644 --- a/htdocs/install/upgrade.php +++ b/htdocs/install/upgrade.php @@ -38,6 +38,11 @@ define('ALLOWED_IF_UPGRADE_UNLOCK_FOUND', 1); include_once 'inc.php'; + +/** + * @var string $conffile + */ + if (!file_exists($conffile)) { print 'Error: Dolibarr config file was not found. This may means that Dolibarr is not installed yet. Please call the page "/install/index.php" instead of "/install/upgrade.php").'; } @@ -46,6 +51,11 @@ require_once $dolibarr_main_document_root.'/core/lib/admin.lib.php'; global $langs; +/** + * @var Conf $conf + * @var Translate $langs + */ + $grant_query = ''; $step = 2; $ok = 0; diff --git a/htdocs/install/upgrade2.php b/htdocs/install/upgrade2.php index 46cff1d2bc6..c3a8b7db52e 100644 --- a/htdocs/install/upgrade2.php +++ b/htdocs/install/upgrade2.php @@ -41,6 +41,11 @@ define('ALLOWED_IF_UPGRADE_UNLOCK_FOUND', 1); include_once 'inc.php'; + +/** + * @var string $conffile + */ + if (!file_exists($conffile)) { print 'Error: Dolibarr config file was not found. This may means that Dolibarr is not installed yet. Please call the page "/install/index.php" instead of "/install/upgrade.php").'; } @@ -56,13 +61,17 @@ require_once $dolibarr_main_document_root.'/core/lib/files.lib.php'; global $langs; +/** + * @var Conf $conf + * @var Translate $langs + */ + $grant_query = ''; $step = 2; $error = 0; -// Cette page peut etre longue. On augmente le delai autorise. -// Ne fonctionne que si on est pas en safe_mode. +// This page can be long. We increase the allowed delay, but this does not work when we are in safe_mode. $err = error_reporting(); error_reporting(0); if (!empty($conf->global->MAIN_OVERRIDE_TIME_LIMIT)) { @@ -224,8 +233,11 @@ if (!GETPOST('action', 'aZ09') || preg_match('/upgrade/i', GETPOST('action', 'aZ $db->begin(); foreach ($listofentities as $entity) { + dol_syslog("Process upgrade2 for entity ".$entity); + // Set $conf context for entity $conf->setEntityValues($db, $entity); + // Reset forced setup after the setValues if (defined('SYSLOG_FILE')) { $conf->global->SYSLOG_FILE = constant('SYSLOG_FILE'); @@ -248,10 +260,11 @@ if (!GETPOST('action', 'aZ09') || preg_match('/upgrade/i', GETPOST('action', 'aZ $versiontoarray = explode('.', $versionto); $versionranarray = explode('.', DOL_VERSION); - $afterversionarray = explode('.', '2.0.0'); $beforeversionarray = explode('.', '2.7.9'); if (versioncompare($versiontoarray, $afterversionarray) >= 0 && versioncompare($versiontoarray, $beforeversionarray) <= 0) { + dol_syslog("Run migrate_... versionto is between ".json_encode($afterversionarray)." and ".json_encode($beforeversionarray)); + // Script pour V2 -> V2.1 migrate_paiements($db, $langs, $conf); @@ -315,6 +328,8 @@ if (!GETPOST('action', 'aZ09') || preg_match('/upgrade/i', GETPOST('action', 'aZ $beforeversionarray = explode('.', '2.8.9'); //print $versionto.' '.versioncompare($versiontoarray,$afterversionarray).' '.versioncompare($versiontoarray,$beforeversionarray); if (versioncompare($versiontoarray, $afterversionarray) >= 0 && versioncompare($versiontoarray, $beforeversionarray) <= 0) { + dol_syslog("Run migrate_... versionto is between ".json_encode($afterversionarray)." and ".json_encode($beforeversionarray)); + migrate_price_facture($db, $langs, $conf); // Code of this function works for 2.8+ because need a field tva_tx migrate_relationship_tables($db, $langs, $conf, 'co_exp', 'fk_commande', 'commande', 'fk_expedition', 'shipping'); @@ -340,6 +355,8 @@ if (!GETPOST('action', 'aZ09') || preg_match('/upgrade/i', GETPOST('action', 'aZ $afterversionarray = explode('.', '2.8.9'); $beforeversionarray = explode('.', '2.9.9'); if (versioncompare($versiontoarray, $afterversionarray) >= 0 && versioncompare($versiontoarray, $beforeversionarray) <= 0) { + dol_syslog("Run migrate_... versionto is between ".json_encode($afterversionarray)." and ".json_encode($beforeversionarray)); + migrate_element_time($db, $langs, $conf); migrate_customerorder_shipping($db, $langs, $conf); @@ -360,6 +377,8 @@ if (!GETPOST('action', 'aZ09') || preg_match('/upgrade/i', GETPOST('action', 'aZ $afterversionarray = explode('.', '3.0.9'); $beforeversionarray = explode('.', '3.1.9'); if (versioncompare($versiontoarray, $afterversionarray) >= 0 && versioncompare($versiontoarray, $beforeversionarray) <= 0) { + dol_syslog("Run migrate_... versionto is between ".json_encode($afterversionarray)." and ".json_encode($beforeversionarray)); + migrate_rename_directories($db, $langs, $conf, '/rss', '/externalrss'); migrate_actioncomm_element($db, $langs, $conf); @@ -369,6 +388,8 @@ if (!GETPOST('action', 'aZ09') || preg_match('/upgrade/i', GETPOST('action', 'aZ $afterversionarray = explode('.', '3.1.9'); $beforeversionarray = explode('.', '3.2.9'); if (versioncompare($versiontoarray, $afterversionarray) >= 0 && versioncompare($versiontoarray, $beforeversionarray) <= 0) { + dol_syslog("Run migrate_... versionto is between ".json_encode($afterversionarray)." and ".json_encode($beforeversionarray)); + migrate_price_contrat($db, $langs, $conf); migrate_mode_reglement($db, $langs, $conf); @@ -380,6 +401,8 @@ if (!GETPOST('action', 'aZ09') || preg_match('/upgrade/i', GETPOST('action', 'aZ $afterversionarray = explode('.', '3.2.9'); $beforeversionarray = explode('.', '3.3.9'); if (versioncompare($versiontoarray, $afterversionarray) >= 0 && versioncompare($versiontoarray, $beforeversionarray) <= 0) { + dol_syslog("Run migrate_... versionto is between ".json_encode($afterversionarray)." and ".json_encode($beforeversionarray)); + migrate_categorie_association($db, $langs, $conf); } @@ -390,6 +413,8 @@ if (!GETPOST('action', 'aZ09') || preg_match('/upgrade/i', GETPOST('action', 'aZ $afterversionarray = explode('.', '3.6.9'); // target is after this $beforeversionarray = explode('.', '3.7.9'); // target is before this if (versioncompare($versiontoarray, $afterversionarray) >= 0 && versioncompare($versiontoarray, $beforeversionarray) <= 0) { + dol_syslog("Run migrate_... versionto is between ".json_encode($afterversionarray)." and ".json_encode($beforeversionarray)); + migrate_event_assignement($db, $langs, $conf); } @@ -404,6 +429,8 @@ if (!GETPOST('action', 'aZ09') || preg_match('/upgrade/i', GETPOST('action', 'aZ $afterversionarray = explode('.', '3.9.9'); $beforeversionarray = explode('.', '4.0.9'); if (versioncompare($versiontoarray, $afterversionarray) >= 0 && versioncompare($versiontoarray, $beforeversionarray) <= 0) { + dol_syslog("Run migrate_... versionto is between ".json_encode($afterversionarray)." and ".json_encode($beforeversionarray)); + migrate_rename_directories($db, $langs, $conf, '/fckeditor', '/medias'); } @@ -411,6 +438,8 @@ if (!GETPOST('action', 'aZ09') || preg_match('/upgrade/i', GETPOST('action', 'aZ $afterversionarray = explode('.', '4.0.9'); $beforeversionarray = explode('.', '5.0.9'); if (versioncompare($versiontoarray, $afterversionarray) >= 0 && versioncompare($versiontoarray, $beforeversionarray) <= 0) { + dol_syslog("Run migrate_... versionto is between ".json_encode($afterversionarray)." and ".json_encode($beforeversionarray)); + // Migrate to add entity value into llx_societe_remise migrate_remise_entity($db, $langs, $conf); @@ -427,6 +456,8 @@ if (!GETPOST('action', 'aZ09') || preg_match('/upgrade/i', GETPOST('action', 'aZ // Only if the transverse mode is not used if (empty($multicompany_transverse_mode)) { + dol_syslog("Run migrate_... versionto is between ".json_encode($afterversionarray)." and ".json_encode($beforeversionarray)); + // Migrate to add entity value into llx_user_rights migrate_user_rights_entity($db, $langs, $conf); @@ -440,6 +471,8 @@ if (!GETPOST('action', 'aZ09') || preg_match('/upgrade/i', GETPOST('action', 'aZ $afterversionarray = explode('.', '6.0.9'); $beforeversionarray = explode('.', '7.0.9'); if (versioncompare($versiontoarray, $afterversionarray) >= 0 && versioncompare($versiontoarray, $beforeversionarray) <= 0) { + dol_syslog("Run migrate_... versionto is between ".json_encode($afterversionarray)." and ".json_encode($beforeversionarray)); + // Migrate contact association migrate_event_assignement_contact($db, $langs, $conf); @@ -450,6 +483,8 @@ if (!GETPOST('action', 'aZ09') || preg_match('/upgrade/i', GETPOST('action', 'aZ $afterversionarray = explode('.', '7.0.9'); $beforeversionarray = explode('.', '8.0.9'); if (versioncompare($versiontoarray, $afterversionarray) >= 0 && versioncompare($versiontoarray, $beforeversionarray) <= 0) { + dol_syslog("Run migrate_... versionto is between ".json_encode($afterversionarray)." and ".json_encode($beforeversionarray)); + migrate_rename_directories($db, $langs, $conf, '/contracts', '/contract'); } @@ -464,6 +499,8 @@ if (!GETPOST('action', 'aZ09') || preg_match('/upgrade/i', GETPOST('action', 'aZ $afterversionarray = explode('.', '10.0.9'); $beforeversionarray = explode('.', '11.0.9'); if (versioncompare($versiontoarray, $afterversionarray) >= 0 && versioncompare($versiontoarray, $beforeversionarray) <= 0) { + dol_syslog("Run migrate_... versionto is between ".json_encode($afterversionarray)." and ".json_encode($beforeversionarray)); + migrate_users_socialnetworks(); migrate_members_socialnetworks(); migrate_contacts_socialnetworks(); @@ -474,6 +511,8 @@ if (!GETPOST('action', 'aZ09') || preg_match('/upgrade/i', GETPOST('action', 'aZ $afterversionarray = explode('.', '13.0.9'); $beforeversionarray = explode('.', '14.0.9'); if (versioncompare($versiontoarray, $afterversionarray) >= 0 && versioncompare($versiontoarray, $beforeversionarray) <= 0) { + dol_syslog("Run migrate_... versionto is between ".json_encode($afterversionarray)." and ".json_encode($beforeversionarray)); + migrate_export_import_profiles('export'); migrate_export_import_profiles('import'); } @@ -482,6 +521,8 @@ if (!GETPOST('action', 'aZ09') || preg_match('/upgrade/i', GETPOST('action', 'aZ $afterversionarray = explode('.', '15.0.9'); $beforeversionarray = explode('.', '16.0.9'); if (versioncompare($versiontoarray, $afterversionarray) >= 0 && versioncompare($versiontoarray, $beforeversionarray) <= 0) { + dol_syslog("Run migrate_... versionto is between ".json_encode($afterversionarray)." and ".json_encode($beforeversionarray)); + migrate_user_photospath(); migrate_user_photospath2(); } @@ -490,6 +531,8 @@ if (!GETPOST('action', 'aZ09') || preg_match('/upgrade/i', GETPOST('action', 'aZ $afterversionarray = explode('.', '16.0.9'); $beforeversionarray = explode('.', '17.0.9'); if (versioncompare($versiontoarray, $afterversionarray) >= 0 && versioncompare($versiontoarray, $beforeversionarray) <= 0) { + dol_syslog("Run migrate_... versionto is between ".json_encode($afterversionarray)." and ".json_encode($beforeversionarray)); + migrate_contractdet_rank(); } @@ -497,13 +540,16 @@ if (!GETPOST('action', 'aZ09') || preg_match('/upgrade/i', GETPOST('action', 'aZ $afterversionarray = explode('.', '17.0.9'); $beforeversionarray = explode('.', '18.0.9'); if (versioncompare($versiontoarray, $afterversionarray) >= 0 && versioncompare($versiontoarray, $beforeversionarray) <= 0) { + dol_syslog("Run migrate_... versionto is between ".json_encode($afterversionarray)." and ".json_encode($beforeversionarray)); + migrate_contractdet_rank(); } } - // Code executed only if migration is LAST ONE. Must always be done. if (versioncompare($versiontoarray, $versionranarray) >= 0 || versioncompare($versiontoarray, $versionranarray) <= -3) { + dol_syslog("Run migrate_... if migration is LAST ONE"); + // Reload modules (this must be always done and only into last targeted version, because code to reload module may need table structure of last version) $listofmodule = array( 'MAIN_MODULE_ACCOUNTING'=>'newboxdefonly', @@ -546,6 +592,7 @@ if (!GETPOST('action', 'aZ09') || preg_match('/upgrade/i', GETPOST('action', 'aZ if ($result < 0) { $error++; } + // Reload menus (this must be always and only into last targeted version) $result = migrate_reload_menu($db, $langs, $conf); if ($result < 0) { diff --git a/test/phpunit/.gitignore b/test/phpunit/.gitignore new file mode 100644 index 00000000000..647a82afb84 --- /dev/null +++ b/test/phpunit/.gitignore @@ -0,0 +1 @@ +/DemoTest.php diff --git a/test/phpunit/SecurityTest.php b/test/phpunit/SecurityTest.php index 3c9015d7f95..301b9128c23 100644 --- a/test/phpunit/SecurityTest.php +++ b/test/phpunit/SecurityTest.php @@ -730,7 +730,8 @@ class SecurityTest extends PHPUnit\Framework\TestCase { $stringtotest = 'eée'; $decodedstring = dol_string_onlythesehtmlattributes($stringtotest); - $this->assertEquals('eée', $decodedstring, 'Function did not sanitize correclty with test 1'); + //$this->assertEquals('eée', $decodedstring, 'Function did not sanitize correctly with test 1'); + $this->assertEquals('eée', $decodedstring, 'Function did not sanitize correctly with test 1'); $stringtotest = ''; $decodedstring = dol_string_onlythesehtmlattributes($stringtotest); @@ -986,6 +987,22 @@ class SecurityTest extends PHPUnit\Framework\TestCase print "result = ".$result."\n"; $this->assertStringContainsString('Bad string syntax to evaluate', $result); + $result = dol_eval('json_encode(array_map(implode("",["ex","ec"]), ["id"]))', 1, 1, '1'); // result of dol_eval may be an object Closure + print "result4a = ".json_encode($result)."\n"; + $this->assertStringContainsString('Bad string syntax to evaluate', json_encode($result), 'The string was not detected as evil, it should due to the [ char and method "2"'); + + $result = dol_eval('json_encode(array_map(implode("",["ex","ec"]), ["id"]))', 1, 1, '2'); // result of dol_eval may be an object Closure + print "result4b = ".json_encode($result)."\n"; + $this->assertStringContainsString('Bad string syntax to evaluate', json_encode($result), 'The string was not detected as evil, it should due to the use of array_map'); + + $result = dol_eval('json_encode(array_map(implode("",array("ex","ec"), array("id")))', 1, 1, '1'); // result of dol_eval may be an object Closure + print "result4c = ".json_encode($result)."\n"; + $this->assertStringContainsString('Bad string syntax to evaluate', json_encode($result), 'The string was not detected as evil, it should due to the use of array_map'); + + $result = dol_eval('$a=function() { }; $a', 1, 1, '0'); // result of dol_eval may be an object Closure + print "result5 = ".json_encode($result)."\n"; + $this->assertStringContainsString('Bad string syntax to evaluate', json_encode($result), 'The string was not detected as evil'); + $result=dol_eval('$a=exec ("ls")', 1, 1); print "result = ".$result."\n"; $this->assertStringContainsString('Bad string syntax to evaluate', $result); From b03c12c12947ad832dfe2b610e70d4df1bf2f3d5 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Tue, 9 Sep 2025 19:25:09 +0200 Subject: [PATCH 30/34] FIX Societe - Problem of date on outstanding opened late (#35266) --- htdocs/societe/class/societe.class.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 14ddcd19613..f2c9efdc3b3 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -4875,10 +4875,12 @@ class Societe extends CommonObject $alreadypayed=price2num($paiement + $creditnotes + $deposits,'MT'); $remaintopay=price2num($invoice->total_ttc - $paiement - $creditnotes - $deposits,'MT'); */ + $today = dol_get_first_hour(dol_now('tzuser')); // Returns today at 00:00 in the user's time zone + $sql = "SELECT rowid, ref, total_ht, total_ttc, paye, type, fk_statut as status, close_code FROM ".MAIN_DB_PREFIX.$table." as f"; $sql .= " WHERE fk_soc = ".((int) $this->id); if (!empty($late)) { - $sql .= " AND date_lim_reglement < '".$this->db->idate(dol_now())."'"; + $sql .= " AND date_lim_reglement < '".$this->db->idate($today)."'"; } if ($mode == 'supplier') { $sql .= " AND entity IN (".getEntity('facture_fourn').")"; From 601d1b986e4446d485ece629762d087bc265103c Mon Sep 17 00:00:00 2001 From: John BOTELLA <68917336+thersane-john@users.noreply.github.com> Date: Wed, 10 Sep 2025 10:51:31 +0200 Subject: [PATCH 31/34] Fix : sql filter for batch stats (#35272) * Fix : sql filter for batch stats * Fix : sql filter for batch stats --------- Co-authored-by: Laurent Destailleur --- htdocs/product/stock/class/productlot.class.php | 1 + htdocs/product/stock/stats/commande_fournisseur.php | 1 + 2 files changed, 2 insertions(+) diff --git a/htdocs/product/stock/class/productlot.class.php b/htdocs/product/stock/class/productlot.class.php index 753810de53f..cc22d5e2431 100644 --- a/htdocs/product/stock/class/productlot.class.php +++ b/htdocs/product/stock/class/productlot.class.php @@ -891,6 +891,7 @@ class Productlot extends CommonObject } $sql .= " WHERE cf.entity IN (".getEntity('expedition').")"; $sql .= " AND cfdi.batch = '".($this->db->escape($this->batch))."'"; + $sql .= " AND cfdi.fk_product = " . (int) $this->fk_product; if (!$user->hasRight('societe', 'client', 'voir')) { $sql .= " AND cf.fk_soc = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } diff --git a/htdocs/product/stock/stats/commande_fournisseur.php b/htdocs/product/stock/stats/commande_fournisseur.php index f09dfa47de6..593e404d5ae 100644 --- a/htdocs/product/stock/stats/commande_fournisseur.php +++ b/htdocs/product/stock/stats/commande_fournisseur.php @@ -230,6 +230,7 @@ if ($id > 0 || !empty($ref)) { } $sql .= " WHERE cf.entity IN (".getEntity('product').")"; $sql .= " AND cfdi.batch = '".($db->escape($object->batch))."'"; + $sql .= " AND cfdi.fk_product = " . (int) $object->fk_product; if (!empty($search_month)) { $sql .= ' AND MONTH(cf.date_commande) IN ('.$db->sanitize($search_month).')'; } From 870c2a8f50e222287fc3ad03c78995440e2f0eba Mon Sep 17 00:00:00 2001 From: Eric - CAP-REL <1468823+rycks@users.noreply.github.com> Date: Thu, 11 Sep 2025 12:21:33 +0200 Subject: [PATCH 32/34] Prepare 18.0.8 (#35299) * Prepare 18.0.8 * Update filefunc.inc.php --------- Co-authored-by: Laurent Destailleur --- ChangeLog | 30 ++++++++++++++++++++++++++++++ htdocs/filefunc.inc.php | 2 +- 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 5dd29b7d23f..c8c324bfd5f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,36 @@ English Dolibarr ChangeLog -------------------------------------------------------------- +***** ChangeLog for 18.0.8 compared to 18.0.7 ***** +35 files changed, 647 insertions(+), 298 deletions(-) + +FIX: #34746 - More complete fix for CVE-2024-40137 +FIX: Correct the calculation of the amount of the current period between the period provided (#35083) +FIX: Add security test for show terminal selection if no terminal selected when invoice.php is call (#34717) +FIX: Add security test for show terminal selection if no terminal selected when invoice.php is call +FIX: missing quick edit for extrafields (baclport commit 4fc66c6) (#35160) +FIX: Missing sentence part (#35144) +FIX: set global mysoc and load langs in API access (#35041) +FIX: set global mysoc and load langs in API access +FIX: reset mysoc and langs only if entity of API has changed +FIX: accountancy general ledger: bad handling of hook return (#34029) +FIX: accountancy general ledger: bad handling of hook return +FIX: accountancy balance: bad handling of hook return +FIX: - Fix missing token for disable custom group category for compta report (page /htdocs/accountancy/admin/categories_list.php) (#35084) +FIX: The combo of custom groups has disappeared (backport v19) (#35016) +FIX: #34893 (#34897) +FIX: #34893 +FIX: change error code to USERNOTALLOWEDTOCHANGEPASS +FIX: asset: could not select invoice in disposal pop-in (#34725) +FIX: 17.0 SQL syntax error and/or constraint error when calling Facture::update() after a clone (e.g. in a trigger) (#34778) +FIX: 17.0: when you clone an invoice that was created from a template invoice, the clone should not be linked to the template invoice (#34777) +FIX: pre-send mail mass action: keep __EMAIL__ substitution (#34522) +FIX: pre-send mail mass action: keep __EMAIL__ substitution +FIX: comment +FIX: massaction email tpl: keep preset +FIX: loop interrupt if an error occurs in sendEmailsRemindersOnInvoiceDueDate (#34657) +FIX: #34654 + ***** ChangeLog for 18.0.7 compared to 18.0.6 ***** 138 files changed, 1622 insertions(+), 530 deletions(-) diff --git a/htdocs/filefunc.inc.php b/htdocs/filefunc.inc.php index 28cbf4915b0..2880f95f814 100644 --- a/htdocs/filefunc.inc.php +++ b/htdocs/filefunc.inc.php @@ -34,7 +34,7 @@ if (!defined('DOL_APPLICATION_TITLE')) { define('DOL_APPLICATION_TITLE', 'Dolibarr'); } if (!defined('DOL_VERSION')) { - define('DOL_VERSION', '18.0.7'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c + define('DOL_VERSION', '18.0.8'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c } if (!defined('EURO')) { From 8efe6d477ee7a9e0450a2b02044104078c722477 Mon Sep 17 00:00:00 2001 From: Eric - CAP-REL <1468823+rycks@users.noreply.github.com> Date: Fri, 12 Sep 2025 02:15:56 +0200 Subject: [PATCH 33/34] exclude escpos-php/doc from filelist_xml (#35313) --- build/generate_filelist_xml.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/generate_filelist_xml.php b/build/generate_filelist_xml.php index 5614b5323bd..331cb8fc178 100755 --- a/build/generate_filelist_xml.php +++ b/build/generate_filelist_xml.php @@ -172,7 +172,7 @@ $files = new RegexIterator($iterator1, '#^(?:[A-Z]:)?(?:/(?!(?:'.($includecustom */ // Define qualified files (must be same than into generate_filelist_xml.php and in api_setup.class.php) $regextoinclude = '\.(php|php3|php4|php5|phtml|phps|phar|inc|css|scss|html|xml|js|json|tpl|jpg|jpeg|png|gif|ico|sql|lang|txt|yml|bak|md|mp3|mp4|wav|mkv|z|gz|zip|rar|tar|less|svg|eot|woff|woff2|ttf|manifest)$'; -$regextoexclude = '('.($includecustom?'':'custom|').'documents|conf|install|dejavu-fonts-ttf-.*|public\/test|sabre\/sabre\/.*\/tests|Shared\/PCLZip|nusoap\/lib\/Mail|php\/example|php\/test|geoip\/sample.*\.php|ckeditor\/samples|ckeditor\/adapters)$'; // Exclude dirs +$regextoexclude = '('.($includecustom?'':'custom|').'documents|escpos-php\/doc|conf|install|dejavu-fonts-ttf-.*|public\/test|sabre\/sabre\/.*\/tests|Shared\/PCLZip|nusoap\/lib\/Mail|php\/example|php\/test|geoip\/sample.*\.php|ckeditor\/samples|ckeditor\/adapters)$'; // Exclude dirs $files = dol_dir_list(DOL_DOCUMENT_ROOT, 'files', 1, $regextoinclude, $regextoexclude, 'fullname'); $dir=''; From 8e689c147944f137b995408cf60152ccc4df641a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 12 Sep 2025 02:26:21 +0200 Subject: [PATCH 34/34] Complete #35313 --- htdocs/api/class/api_setup.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/api/class/api_setup.class.php b/htdocs/api/class/api_setup.class.php index abb09397361..2010e41fbb4 100644 --- a/htdocs/api/class/api_setup.class.php +++ b/htdocs/api/class/api_setup.class.php @@ -2127,7 +2127,7 @@ class Setup extends DolibarrApi // Define qualified files (must be same than into generate_filelist_xml.php and in api_setup.class.php) $regextoinclude = '\.(php|php3|php4|php5|phtml|phps|phar|inc|css|scss|html|xml|js|json|tpl|jpg|jpeg|png|gif|ico|sql|lang|txt|yml|bak|md|mp3|mp4|wav|mkv|z|gz|zip|rar|tar|less|svg|eot|woff|woff2|ttf|manifest)$'; - $regextoexclude = '('.($includecustom ? '' : 'custom|').'documents|conf|install|dejavu-fonts-ttf-.*|public\/test|sabre\/sabre\/.*\/tests|Shared\/PCLZip|nusoap\/lib\/Mail|php\/example|php\/test|geoip\/sample.*\.php|ckeditor\/samples|ckeditor\/adapters)$'; // Exclude dirs + $regextoexclude = '('.($includecustom ? '' : 'custom|').'documents|escpos-php\/doc|conf|install|dejavu-fonts-ttf-.*|public\/test|sabre\/sabre\/.*\/tests|Shared\/PCLZip|nusoap\/lib\/Mail|php\/example|php\/test|geoip\/sample.*\.php|ckeditor\/samples|ckeditor\/adapters)$'; // Exclude dirs $scanfiles = dol_dir_list(DOL_DOCUMENT_ROOT, 'files', 1, $regextoinclude, $regextoexclude); // Fill file_list with files in signature, new files, modified files