From f307d28c1233dfeee8b9867c7de36f3b08e5ae6f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 24 Aug 2024 14:25:51 +0200 Subject: [PATCH] Fix some warnings --- htdocs/adherents/admin/member.php | 2 ++ htdocs/admin/agenda_extsites.php | 2 ++ htdocs/core/lib/admin.lib.php | 6 +++--- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/htdocs/adherents/admin/member.php b/htdocs/adherents/admin/member.php index 2077d61dd9b..0a1ab7f6610 100644 --- a/htdocs/adherents/admin/member.php +++ b/htdocs/adherents/admin/member.php @@ -56,6 +56,8 @@ $type = 'member'; $action = GETPOST('action', 'aZ09'); $modulepart = GETPOST('modulepart', 'aZ09'); +$reg = array(); + /* * Actions diff --git a/htdocs/admin/agenda_extsites.php b/htdocs/admin/agenda_extsites.php index 12c91161e92..99ae2a7d68a 100644 --- a/htdocs/admin/agenda_extsites.php +++ b/htdocs/admin/agenda_extsites.php @@ -53,6 +53,8 @@ $MAXAGENDA = getDolGlobalString('AGENDA_EXT_NB'); // List of available colors $colorlist = array('BECEDD', 'DDBECE', 'BFDDBE', 'F598B4', 'F68654', 'CBF654', 'A4A4A5'); +$reg = array(); + /* * Actions diff --git a/htdocs/core/lib/admin.lib.php b/htdocs/core/lib/admin.lib.php index 24cf59892ee..f9dc8b5e262 100644 --- a/htdocs/core/lib/admin.lib.php +++ b/htdocs/core/lib/admin.lib.php @@ -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 .= ")";