mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-16 22:41:30 +01:00
Fix SQLi reported by op7ica
This commit is contained in:
@@ -1451,7 +1451,7 @@ function dol_set_user_param($db, $conf, &$user, $tab)
|
||||
foreach ($tab as $key => $value)
|
||||
{
|
||||
if ($i > 0) $sql.=',';
|
||||
$sql.="'".$key."'";
|
||||
$sql.="'".$this->db->escape($key)."'";
|
||||
$i++;
|
||||
}
|
||||
$sql.= ")";
|
||||
@@ -1472,7 +1472,7 @@ function dol_set_user_param($db, $conf, &$user, $tab)
|
||||
{
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."user_param(fk_user,entity,param,value)";
|
||||
$sql.= " VALUES (".$user->id.",".$conf->entity.",";
|
||||
$sql.= " '".$key."','".$db->escape($value)."')";
|
||||
$sql.= " '".$this->db->escape($key)."','".$db->escape($value)."')";
|
||||
|
||||
dol_syslog("functions2.lib::dol_set_user_param", LOG_DEBUG);
|
||||
$result=$db->query($sql);
|
||||
|
||||
@@ -1682,12 +1682,12 @@ else
|
||||
}
|
||||
else if ($object->codeclient_modifiable())
|
||||
{
|
||||
print '<input type="text" name="code_client" id="customer_code" size="16" value="'.$object->code_client.'" maxlength="15">';
|
||||
print '<input type="text" name="code_client" id="customer_code" size="16" value="'.dol_escape_htmltag($object->code_client).'" maxlength="15">';
|
||||
}
|
||||
else
|
||||
{
|
||||
print $object->code_client;
|
||||
print '<input type="hidden" name="code_client" value="'.$object->code_client.'">';
|
||||
print '<input type="hidden" name="code_client" value="'.dol_escape_htmltag($object->code_client).'">';
|
||||
}
|
||||
print '</td><td>';
|
||||
$s=$modCodeClient->getToolTip($langs,$object,0);
|
||||
|
||||
Reference in New Issue
Block a user