2
0
forked from Wavyzz/dolibarr

Fix some warnings

This commit is contained in:
Laurent Destailleur
2024-08-24 14:25:51 +02:00
parent 1bfecb5e3b
commit f307d28c12
3 changed files with 7 additions and 3 deletions

View File

@@ -56,6 +56,8 @@ $type = 'member';
$action = GETPOST('action', 'aZ09'); $action = GETPOST('action', 'aZ09');
$modulepart = GETPOST('modulepart', 'aZ09'); $modulepart = GETPOST('modulepart', 'aZ09');
$reg = array();
/* /*
* Actions * Actions

View File

@@ -53,6 +53,8 @@ $MAXAGENDA = getDolGlobalString('AGENDA_EXT_NB');
// List of available colors // List of available colors
$colorlist = array('BECEDD', 'DDBECE', 'BFDDBE', 'F598B4', 'F68654', 'CBF654', 'A4A4A5'); $colorlist = array('BECEDD', 'DDBECE', 'BFDDBE', 'F598B4', 'F68654', 'CBF654', 'A4A4A5');
$reg = array();
/* /*
* Actions * Actions

View File

@@ -572,7 +572,7 @@ function run_sql($sqlfile, $silent = 1, $entity = 0, $usesavepoint = 1, $handler
* Delete a constant * Delete a constant
* *
* @param DoliDB $db Database handler * @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 * @param int $entity Multi company id, -1 for all entities
* @return int Return integer <0 if KO, >0 if OK * @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 = "DELETE FROM ".MAIN_DB_PREFIX."const";
$sql .= " WHERE (".$db->decrypt('name')." = '".$db->escape($name)."'"; $sql .= " WHERE (".$db->decrypt('name')." = '".$db->escape((string) $name)."'";
if (is_numeric($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 .= " OR rowid = ".((int) $name);
} }
$sql .= ")"; $sql .= ")";