Fix delete of profiles

This commit is contained in:
Laurent Destailleur 2020-09-30 18:39:23 +02:00
parent f442dac2c9
commit 1690468da5
4 changed files with 9 additions and 9 deletions

View File

@ -736,7 +736,7 @@ class Export
{
$sql = 'SELECT em.rowid, em.label, em.type, em.field, em.filter';
$sql .= ' FROM '.MAIN_DB_PREFIX.'export_model as em';
$sql .= ' WHERE em.rowid = '.$id;
$sql .= ' WHERE em.rowid = '.((int) $id);
dol_syslog("Export::fetch", LOG_DEBUG);
$result = $this->db->query($sql);

View File

@ -302,9 +302,9 @@ if ($step == 5 && $action == 'confirm_deletefile' && $confirm == 'yes')
if ($action == 'deleteprof')
{
if ($_GET["id"])
if (GETPOST("id", 'int'))
{
$objexport->fetch($_GET["id"]);
$objexport->fetch(GETPOST('id', 'int'));
$result = $objexport->delete($user);
}
}
@ -1054,7 +1054,7 @@ if ($step == 4 && $datatoexport)
print '<tr class="oddeven">';
print '<td><input name="export_name" size="32" value=""></td><td class="right">';
print '<input type="submit" class="button" value="'.$langs->trans("Save").'">';
print '<input type="submit" class="button reposition" value="'.$langs->trans("Save").'">';
print '</td></tr>';
// List of existing export profils
@ -1074,7 +1074,7 @@ if ($step == 4 && $datatoexport)
print '<tr class="oddeven"><td>';
print $obj->label;
print '</td><td class="right">';
print '<a href="'.$_SERVER["PHP_SELF"].'?step='.$step.'&datatoexport='.$datatoexport.'&action=deleteprof&id='.$obj->rowid.'">';
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?step='.$step.'&datatoexport='.$datatoexport.'&action=deleteprof&token='.newToken().'&id='.$obj->rowid.'">';
print img_delete();
print '</a>';
print '</tr>';

View File

@ -278,7 +278,7 @@ class Import
{
$sql = 'SELECT em.rowid, em.field, em.label, em.type';
$sql .= ' FROM '.MAIN_DB_PREFIX.'import_model as em';
$sql .= ' WHERE em.rowid = '.$id;
$sql .= ' WHERE em.rowid = '.((int) $id);
dol_syslog(get_class($this)."::fetch", LOG_DEBUG);
$result = $this->db->query($sql);

View File

@ -148,9 +148,9 @@ if ($action == 'builddoc')
if ($action == 'deleteprof')
{
if ($_GET["id"])
if (GETPOST("id", 'int'))
{
$objimport->fetch($_GET["id"]);
$objimport->fetch(GETPOST("id", 'int'));
$result = $objimport->delete($user);
}
}
@ -1160,7 +1160,7 @@ if ($step == 4 && $datatoimport)
print '<tr class="oddeven"><td>';
print $obj->label;
print '</td><td style="text-align:right">';
print '<a href="'.$_SERVER["PHP_SELF"].'?step='.$step.$param.'&action=deleteprof&id='.$obj->rowid.'&filetoimport='.urlencode($filetoimport).'">';
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?step='.$step.$param.'&action=deleteprof&token='.newToken().'&id='.$obj->rowid.'&filetoimport='.urlencode($filetoimport).'">';
print img_delete();
print '</a>';
print '</tr>';