Merge branch '20.0' of git@github.com:Dolibarr/dolibarr.git into 21.0

This commit is contained in:
Laurent Destailleur
2025-05-20 21:59:28 +02:00
2 changed files with 20 additions and 1 deletions

View File

@@ -1005,6 +1005,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
@@ -1054,11 +1055,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

View File

@@ -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;