Fix sql error in repair.php

This commit is contained in:
Laurent Destailleur 2021-12-09 10:00:42 +01:00
parent 9d11d265ec
commit 92a0c9e4fb

View File

@ -1178,9 +1178,9 @@ if ($ok && GETPOST('clean_perm_table', 'alpha')) {
$listofmods = ''; $listofmods = '';
foreach ($conf->modules as $key => $val) { foreach ($conf->modules as $key => $val) {
$listofmods .= ($listofmods ? ',' : '')."'".$val."'"; $listofmods .= ($listofmods ? ',' : '')."'".$db->escape($val)."'";
} }
$sql = 'SELECT id, libelle as label, module from '.MAIN_DB_PREFIX.'rights_def WHERE module NOT IN ('.$db->sanitize($listofmods).') AND id > 100000'; $sql = 'SELECT id, libelle as label, module from '.MAIN_DB_PREFIX.'rights_def WHERE module NOT IN ('.$db->sanitize($listofmods, 1).') AND id > 100000';
$resql = $db->query($sql); $resql = $db->query($sql);
if ($resql) { if ($resql) {
$num = $db->num_rows($resql); $num = $db->num_rows($resql);