forked from Wavyzz/dolibarr
Fix some warnings
This commit is contained in:
@@ -572,7 +572,7 @@ function run_sql($sqlfile, $silent = 1, $entity = 0, $usesavepoint = 1, $handler
|
||||
* Delete a constant
|
||||
*
|
||||
* @param DoliDB $db Database handler
|
||||
* @param string $name Name of constant or rowid of line
|
||||
* @param int|string $name Name of constant or rowid of line
|
||||
* @param int $entity Multi company id, -1 for all entities
|
||||
* @return int Return integer <0 if KO, >0 if OK
|
||||
*
|
||||
@@ -602,8 +602,8 @@ function dolibarr_del_const($db, $name, $entity = 1)
|
||||
}
|
||||
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."const";
|
||||
$sql .= " WHERE (".$db->decrypt('name')." = '".$db->escape($name)."'";
|
||||
if (is_numeric($name)) {
|
||||
$sql .= " WHERE (".$db->decrypt('name')." = '".$db->escape((string) $name)."'";
|
||||
if (is_numeric($name)) { // This case seems used in the setup of constant page only, to delete a line.
|
||||
$sql .= " OR rowid = ".((int) $name);
|
||||
}
|
||||
$sql .= ")";
|
||||
|
||||
Reference in New Issue
Block a user