From 1486dea1c2c6ba1e25d3fd31ae2e0dc6bc5f2d2b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 18 Nov 2024 13:35:04 +0100 Subject: [PATCH] Debug v21 --- htdocs/core/actions_setmoduleoptions.inc.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/htdocs/core/actions_setmoduleoptions.inc.php b/htdocs/core/actions_setmoduleoptions.inc.php index fd622c1017f..3d1725e4a46 100644 --- a/htdocs/core/actions_setmoduleoptions.inc.php +++ b/htdocs/core/actions_setmoduleoptions.inc.php @@ -129,13 +129,19 @@ if ($action == 'setModuleOptions' && !empty($user->admin)) { foreach ($_POST as $key => $val) { $reg = array(); if (preg_match('/^param(\d*)$/', $key, $reg)) { // Works for POST['param'], POST['param1'], POST['param2'], ... - $param = GETPOST("param".$reg[1], 'alpha'); + $param = GETPOST("param".$reg[1], 'aZ09'); $value = GETPOST("value".$reg[1], 'alpha'); if ($param) { $res = dolibarr_set_const($db, $param, $value, 'chaine', 0, '', $conf->entity); if (!($res > 0)) { $error++; } + + // Case we modify the list of directories for ODT templases, we want to be sure directory exists + if (preg_match('/_ADDON_PDF_ODT_PATH$/', $param) && preg_match('/^DOL_DATA_ROOT/', $value)) { + $tmpdir = preg_replace('/^DOL_DATA_ROOT/', DOL_DATA_ROOT, $value); + dol_mkdir($tmpdir, DOL_DATA_ROOT); + } } } }