From 935051d80379042ed1718b76304cb4d98e200647 Mon Sep 17 00:00:00 2001 From: Lucas Marcouiller <45882981+Hystepik@users.noreply.github.com> Date: Wed, 14 May 2025 12:53:21 +0200 Subject: [PATCH 1/3] Fix bad replace to empty string on GETPOST (#34129) --- htdocs/core/lib/functions.lib.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 38f4ce1f606..a3000cdf430 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -962,6 +962,7 @@ function GETPOST($paramname, $check = 'alphanohtml', $method = 0, $filter = null '@phan-var-force string $paramname'; if (!is_array($out) && empty($_POST[$paramname]) && empty($noreplace)) { $reg = array(); + $regreplace = array(); $maxloop = 20; $loopnb = 0; // Protection against infinite loop while (preg_match('/__([A-Z0-9]+_?[A-Z0-9]+)__/i', $out, $reg) && ($loopnb < $maxloop)) { // Detect '__ABCDEF__' as key 'ABCDEF' and '__ABC_DEF__' as key 'ABC_DEF'. Detection is also correct when 2 vars are side by side. @@ -1010,11 +1011,17 @@ function GETPOST($paramname, $check = 'alphanohtml', $method = 0, $filter = null } elseif ($reg[1] == 'ID') { $newout = '__ID__'; // We keep __ID__ we find into backtopage url } else { - $newout = ''; // Key not found, we replace with empty string + $newout = 'REGREPLACE_'.$loopnb; // Key not found, we replace with temporary string to reload later + $regreplace[$loopnb] = $reg[0]; } //var_dump('__'.$reg[1].'__ -> '.$newout); $out = preg_replace('/__'.preg_quote($reg[1], '/').'__/', $newout, $out); } + if (!empty($regreplace)) { + foreach ($regreplace as $key => $value) { + $out = preg_replace('/REGREPLACE_'.$key.'/', $value, $out); + } + } } // Check type of variable and make sanitization according to this From 6c0d9478315679b8b11728f7c5d699ebd072c5e8 Mon Sep 17 00:00:00 2001 From: Mohamed DAOUD Date: Wed, 14 May 2025 13:08:54 +0200 Subject: [PATCH 2/3] Update html.form.class.php (#34128) --- htdocs/core/class/html.form.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 80ed0b87cf5..ae288fce122 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -3814,7 +3814,7 @@ class Form $optstart .= ' data-supplier-ref="' . dol_escape_htmltag($objp->ref_fourn) . '"'; if (isModEnabled('multicurrency')) { $optstart .= ' data-multicurrency-code="' . dol_escape_htmltag($objp->multicurrency_code) . '"'; - $optstart .= ' data-multicurrency-up="' . dol_escape_htmltag($objp->multicurrency_unitprice) . '"'; + $optstart .= ' data-multicurrency-unitprice="' . dol_escape_htmltag($objp->multicurrency_unitprice) . '"'; } } $optstart .= ' data-description="' . dol_escape_htmltag($objp->description, 0, 1) . '"'; From aa93bf3f31ea828acf5985aa6b91bf9b97af00cb Mon Sep 17 00:00:00 2001 From: Marc de Lima Lucio <68746600+marc-dll@users.noreply.github.com> Date: Tue, 20 May 2025 20:36:51 +0200 Subject: [PATCH 3/3] FIX: pgsql: boolean fields correctly defined in creation but not in migration (#34215) --- htdocs/install/mysql/migration/18.0.0-19.0.0.sql | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/htdocs/install/mysql/migration/18.0.0-19.0.0.sql b/htdocs/install/mysql/migration/18.0.0-19.0.0.sql index aa869240a42..36259f40cfc 100644 --- a/htdocs/install/mysql/migration/18.0.0-19.0.0.sql +++ b/htdocs/install/mysql/migration/18.0.0-19.0.0.sql @@ -222,3 +222,15 @@ UPDATE llx_c_units SET scale = 1 WHERE code = 'S'; UPDATE llx_c_tva SET taux = 3 WHERE fk_pays = 102 AND taux = 16; UPDATE llx_menu SET url = CONCAT(url, '&mode=init') WHERE fk_mainmenu = 'ticket' AND titre = 'NewTicket' AND url LIKE '/ticket/card.php?action=create%' AND url NOT LIKE '%mode=init%'; + +-- VMYSQL4.1 ALTER TABLE llx_asset MODIFY COLUMN not_depreciated boolean DEFAULT false; +-- VPGSQL8.2 ALTER TABLE llx_asset ALTER COLUMN not_depreciated DROP DEFAULT, ALTER COLUMN not_depreciated TYPE boolean USING not_depreciated::integer <> 0, ALTER COLUMN not_depreciated SET DEFAULT false; + +-- VMYSQL4.1 ALTER TABLE llx_asset MODIFY COLUMN disposal_depreciated boolean DEFAULT false; +-- VPGSQL8.2 ALTER TABLE llx_asset ALTER COLUMN disposal_depreciated DROP DEFAULT, ALTER COLUMN disposal_depreciated TYPE boolean USING disposal_depreciated::integer <> 0, ALTER COLUMN disposal_depreciated SET DEFAULT false; + +-- VMYSQL4.1 ALTER TABLE llx_asset MODIFY COLUMN disposal_subject_to_vat boolean DEFAULT false; +-- VPGSQL8.2 ALTER TABLE llx_asset ALTER COLUMN disposal_subject_to_vat DROP DEFAULT, ALTER COLUMN disposal_subject_to_vat TYPE boolean USING disposal_subject_to_vat::integer <> 0, ALTER COLUMN disposal_subject_to_vat SET DEFAULT false; + +-- VMYSQL4.1 ALTER TABLE llx_asset_depreciation_options_economic MODIFY COLUMN accelerated_depreciation_option boolean DEFAULT false; +-- VPGSQL8.2 ALTER TABLE llx_asset ALTER COLUMN llx_asset_depreciation_options_economic DROP DEFAULT, ALTER COLUMN llx_asset_depreciation_options_economic TYPE boolean USING llx_asset_depreciation_options_economic::integer <> 0, ALTER COLUMN llx_asset_depreciation_options_economic SET DEFAULT false;