From 130c2e2a8fd8e546f10770cc1f2b69bc655e546c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 13 May 2024 11:27:56 +0200 Subject: [PATCH] Clean code --- dev/tools/phan/baseline.txt | 4 ++-- htdocs/admin/order.php | 2 ++ htdocs/core/modules/modCommande.class.php | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/dev/tools/phan/baseline.txt b/dev/tools/phan/baseline.txt index 5af4266911b..b29cce1a663 100644 --- a/dev/tools/phan/baseline.txt +++ b/dev/tools/phan/baseline.txt @@ -4,7 +4,7 @@ * When Phan is invoked with --load-baseline=path/to/baseline.php, * The pre-existing issues listed in this file won't be emitted. * - * This file can be updated by invoking Phan with --save-baseline=path/to/baseline.php + * This file can be updated by invoking Phan with --save-baseline=path/to/baseline.txt * (can be combined with --load-baseline) */ return [ @@ -114,7 +114,6 @@ return [ 'htdocs/admin/barcode.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredMethod', 'PhanUndeclaredProperty'], 'htdocs/admin/bom.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredMethod'], 'htdocs/admin/chequereceipts.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredMethod'], - 'htdocs/admin/commande.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredMethod'], 'htdocs/admin/company.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/admin/contract.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredMethod'], 'htdocs/admin/delais.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchDimFetch'], @@ -157,6 +156,7 @@ return [ 'htdocs/admin/mrp_extrafields.php' => ['PhanUndeclaredGlobalVariable'], 'htdocs/admin/multicurrency.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/admin/oauthlogintokens.php' => ['PhanPluginUnknownObjectMethodCall'], + 'htdocs/admin/order.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanUndeclaredMethod'], 'htdocs/admin/payment.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredMethod'], 'htdocs/admin/pdf.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/admin/perms.php' => ['PhanPluginUnknownObjectMethodCall'], diff --git a/htdocs/admin/order.php b/htdocs/admin/order.php index 29a11a2a3b4..687c91f07db 100644 --- a/htdocs/admin/order.php +++ b/htdocs/admin/order.php @@ -65,6 +65,8 @@ if ($action == 'updateMask') { $maskconstorder = GETPOST('maskconstorder', 'aZ09'); $maskorder = GETPOST('maskorder', 'alpha'); + $res = 0; + if ($maskconstorder && preg_match('/_MASK$/', $maskconstorder)) { $res = dolibarr_set_const($db, $maskconstorder, $maskorder, 'chaine', 0, '', $conf->entity); } diff --git a/htdocs/core/modules/modCommande.class.php b/htdocs/core/modules/modCommande.class.php index 79ffc737773..29ec4fcfe4b 100644 --- a/htdocs/core/modules/modCommande.class.php +++ b/htdocs/core/modules/modCommande.class.php @@ -66,7 +66,7 @@ class modCommande extends DolibarrModules $this->dirs = array("/commande/temp"); // Config pages - $this->config_page_url = array("commande.php"); + $this->config_page_url = array("order.php"); // Dependencies $this->depends = array("modSociete");