Sanitize for security.
This commit is contained in:
parent
21a6fd1cb4
commit
1598a5d3a6
@ -66,12 +66,15 @@ $conffiletoshow = "htdocs/conf/conf.php";
|
|||||||
//$conffile = "/etc/dolibarr/conf.php";
|
//$conffile = "/etc/dolibarr/conf.php";
|
||||||
//$conffiletoshow = "/etc/dolibarr/conf.php";
|
//$conffiletoshow = "/etc/dolibarr/conf.php";
|
||||||
|
|
||||||
//replace conf filename with "conf" parameter on url by GET
|
// Replace conf filename with "conf" parameter on url by GET
|
||||||
if (!empty($_GET['conf'])) {
|
if (GETPOST('conf'))
|
||||||
setcookie('dolconf', $_GET['conf'],0,'/');
|
{
|
||||||
$conffile = 'conf/' . $_GET['conf'] . '.php';
|
setcookie('dolconf', GETPOST('conf'),0,'/');
|
||||||
} else {
|
$conffile = 'conf/' . dol_sanitizeFileName(GETPOST('conf')) . '.php';
|
||||||
$conffile = 'conf/' . (!empty($_COOKIE['dolconf']) ? $_COOKIE['dolconf'] : 'conf') . '.php';
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$conffile = 'conf/' . dol_sanitizeFileName((!empty($_COOKIE['dolconf']) ? $_COOKIE['dolconf'] : 'conf') . '.php');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user