From 5870f40e34de3627e72720bf6f8e71a783eaf9e0 Mon Sep 17 00:00:00 2001 From: thibdrev Date: Thu, 18 Jan 2024 20:22:41 +0100 Subject: [PATCH] fix: phpstan htdocs/adherents/card.php 310 Property CommonObject::$state_id (int) does not accept array|string. htdocs/adherents/card.php 311 Property CommonObject::$country_id (int) does not accept array|string. htdocs/adherents/card.php 337 Property CommonObject::$statut (int) does not accept array|string. htdocs/adherents/card.php 338 Property CommonObject::$status (int) does not accept array|string. htdocs/adherents/card.php 339 Property Adherent::$public (int) does not accept array|string. --- htdocs/adherents/card.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php index 4ecdad298ff..ca6ab3557ed 100644 --- a/htdocs/adherents/card.php +++ b/htdocs/adherents/card.php @@ -307,8 +307,8 @@ if (empty($reshook)) { $object->address = trim(GETPOST("address", 'alphanohtml')); $object->zip = trim(GETPOST("zipcode", 'alphanohtml')); $object->town = trim(GETPOST("town", 'alphanohtml')); - $object->state_id = GETPOST("state_id", 'int'); - $object->country_id = GETPOST("country_id", 'int'); + $object->state_id = GETPOSTINT("state_id"); + $object->country_id = GETPOSTINT("country_id"); $object->phone = trim(GETPOST("phone", 'alpha')); $object->phone_perso = trim(GETPOST("phone_perso", 'alpha')); @@ -334,9 +334,9 @@ if (empty($reshook)) { } // Get status and public property - $object->statut = GETPOST("statut", 'alpha'); - $object->status = GETPOST("statut", 'alpha'); - $object->public = GETPOST("public", 'alpha'); + $object->statut = GETPOSTINT("statut"); + $object->status = GETPOSTINT("statut"); + $object->public = GETPOSTINT("public"); // Fill array 'array_options' with data from add form $ret = $extrafields->setOptionalsFromPost(null, $object, '@GETPOSTISSET');