From 093bbcdec2f805363ccea32dfacf174bc1253d34 Mon Sep 17 00:00:00 2001 From: MDW Date: Fri, 7 Nov 2025 18:48:05 +0100 Subject: [PATCH] Qual: Fix false phan positive in export.php (#36147) * Qual: Type cast for field parameter # Qual: Type cast for field parameter Cast to string to ensure the value is not interpreted as a potential array. * Qual: Backport typing hint to fix typing in 20.0 --- htdocs/exports/class/export.class.php | 3 +++ htdocs/exports/export.php | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/htdocs/exports/class/export.class.php b/htdocs/exports/class/export.class.php index ca85fad2e21..c5cc14d7fae 100644 --- a/htdocs/exports/class/export.class.php +++ b/htdocs/exports/class/export.class.php @@ -70,6 +70,9 @@ class Export public $array_export_TypeFields = array(); // Tableau des listes de champ+Type de filtre public $array_export_FilterValue = array(); // Tableau des listes de champ+Valeur a filtrer public $array_export_entities = array(); // Tableau des listes de champ+alias a exporter + /** + * @var array> + */ public $array_export_dependencies = array(); // array of list of entities that must take care of the DISTINCT if a field is added into export public $array_export_special = array(); // array of special operations to do on field public $array_export_examplevalues = array(); // array with examples for fields diff --git a/htdocs/exports/export.php b/htdocs/exports/export.php index 9262f6d5457..a88898faaa8 100644 --- a/htdocs/exports/export.php +++ b/htdocs/exports/export.php @@ -146,7 +146,7 @@ $step = GETPOSTINT("step") ? GETPOSTINT("step") : 1; $export_name = GETPOST("export_name", "alphanohtml"); $hexa = GETPOST("hexa", "alpha"); $exportmodelid = GETPOSTINT("exportmodelid"); -$field = GETPOST("field", "alpha"); +$field = (string) GETPOST("field", "alpha"); $objexport = new Export($db); $objexport->load_arrays($user, $datatoexport);