From 73a1119b263406bc709bc1a46ddece37865f1adb Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 11 Jun 2021 15:21:24 +0200 Subject: [PATCH] Clean code --- htdocs/accountancy/index.php | 2 +- htdocs/adherents/index.php | 2 +- htdocs/core/class/infobox.class.php | 4 ++-- htdocs/index.php | 2 +- htdocs/societe/index.php | 2 +- htdocs/user/home.php | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/htdocs/accountancy/index.php b/htdocs/accountancy/index.php index d073139a533..6e13a662948 100644 --- a/htdocs/accountancy/index.php +++ b/htdocs/accountancy/index.php @@ -61,7 +61,7 @@ if (empty($user->rights->compta->resultat->lire) && empty($user->rights->account if (GETPOST('addbox')) { // Add box (when submit is done from a form when ajax disabled) require_once DOL_DOCUMENT_ROOT.'/core/class/infobox.class.php'; - $zone = GETPOST('areacode', 'aZ09'); + $zone = GETPOST('areacode', 'int'); $userid = GETPOST('userid', 'int'); $boxorder = GETPOST('boxorder', 'aZ09'); $boxorder .= GETPOST('boxcombo', 'aZ09'); diff --git a/htdocs/adherents/index.php b/htdocs/adherents/index.php index 998736e137f..8b59c0d3ca4 100644 --- a/htdocs/adherents/index.php +++ b/htdocs/adherents/index.php @@ -52,7 +52,7 @@ $result = restrictedArea($user, 'adherent'); if (GETPOST('addbox')) { // Add box (when submit is done from a form when ajax disabled) require_once DOL_DOCUMENT_ROOT.'/core/class/infobox.class.php'; - $zone = GETPOST('areacode', 'aZ09'); + $zone = GETPOST('areacode', 'int'); $userid = GETPOST('userid', 'int'); $boxorder = GETPOST('boxorder', 'aZ09'); $boxorder .= GETPOST('boxcombo', 'aZ09'); diff --git a/htdocs/core/class/infobox.class.php b/htdocs/core/class/infobox.class.php index 82e7227763f..fb59e2b7c42 100644 --- a/htdocs/core/class/infobox.class.php +++ b/htdocs/core/class/infobox.class.php @@ -85,7 +85,7 @@ class InfoBox * * @param DoliDB $db Database handler * @param string $mode 'available' or 'activated' - * @param string $zone Name or area (-1 for all, 0 for Homepage, 1 for Accountancy, 2 for xxx, ...) + * @param int $zone Name or area (-1 for all, 0 for Homepage, 1 for Accountancy, 2 for xxx, ...) * @param User|null $user Object user to filter * @param array $excludelist Array of box id (box.box_id = boxes_def.rowid) to exclude * @param int $includehidden Include also hidden boxes @@ -216,7 +216,7 @@ class InfoBox * Save order of boxes for area and user * * @param DoliDB $db Database handler - * @param string $zone Name of area (0 for Homepage, ...) + * @param int $zone Name of area (0 for Homepage, ...) * @param string $boxorder List of boxes with correct order 'A:123,456,...-B:789,321...' * @param int $userid Id of user * @return int <0 if KO, 0=Nothing done, > 0 if OK diff --git a/htdocs/index.php b/htdocs/index.php index 79a957a52c7..7eaf517b321 100644 --- a/htdocs/index.php +++ b/htdocs/index.php @@ -52,7 +52,7 @@ if (count($conf->modules) <= (empty($conf->global->MAIN_MIN_NB_ENABLED_MODULE_FO } if (GETPOST('addbox')) { // Add box (when submit is done from a form when ajax disabled) require_once DOL_DOCUMENT_ROOT.'/core/class/infobox.class.php'; - $zone = GETPOST('areacode', 'aZ09'); + $zone = GETPOST('areacode', 'int'); $userid = GETPOST('userid', 'int'); $boxorder = GETPOST('boxorder', 'aZ09'); $boxorder .= GETPOST('boxcombo', 'aZ09'); diff --git a/htdocs/societe/index.php b/htdocs/societe/index.php index f56beedb64e..f5a4392a0c0 100644 --- a/htdocs/societe/index.php +++ b/htdocs/societe/index.php @@ -57,7 +57,7 @@ $resultboxes = FormOther::getBoxesArea($user, "3"); if (GETPOST('addbox')) { // Add box (when submit is done from a form when ajax disabled) require_once DOL_DOCUMENT_ROOT.'/core/class/infobox.class.php'; - $zone = GETPOST('areacode', 'aZ09'); + $zone = GETPOST('areacode', 'int'); $userid = GETPOST('userid', 'int'); $boxorder = GETPOST('boxorder', 'aZ09'); $boxorder .= GETPOST('boxcombo', 'aZ09'); diff --git a/htdocs/user/home.php b/htdocs/user/home.php index 4a41b3fd899..fbfe4638bd5 100644 --- a/htdocs/user/home.php +++ b/htdocs/user/home.php @@ -62,7 +62,7 @@ $resultboxes = FormOther::getBoxesArea($user, "1"); if (GETPOST('addbox')) { // Add box (when submit is done from a form when ajax disabled) require_once DOL_DOCUMENT_ROOT.'/core/class/infobox.class.php'; - $zone = GETPOST('areacode', 'aZ09'); + $zone = GETPOST('areacode', 'int'); $userid = GETPOST('userid', 'int'); $boxorder = GETPOST('boxorder', 'aZ09'); $boxorder .= GETPOST('boxcombo', 'aZ09');