From 3682cec8ff2e1ca23067024a4ba82415be5d2af3 Mon Sep 17 00:00:00 2001 From: MDW Date: Tue, 19 Mar 2024 21:31:04 +0100 Subject: [PATCH] Fix arg type to preg_match() with cast --- htdocs/fourn/class/fournisseur.commande.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index add091dd124..d9f7863c16c 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -1974,7 +1974,7 @@ class CommandeFournisseur extends CommonOrder $pu_ht = price2num($pu_ht); $pu_ht_devise = price2num($pu_ht_devise); $pu_ttc = price2num($pu_ttc); - if (!preg_match('/\((.*)\)/', $txtva)) { + if (!preg_match('/\((.*)\)/', (string) $txtva)) { $txtva = price2num($txtva); // $txtva can have format '5.0(XXX)' or '5' } $txlocaltax1 = price2num($txlocaltax1); @@ -2934,7 +2934,7 @@ class CommandeFournisseur extends CommonOrder } $pu = price2num($pu); $pu_ht_devise = price2num($pu_ht_devise); - if (!preg_match('/\((.*)\)/', $txtva)) { + if (!preg_match('/\((.*)\)/', (string) $txtva)) { $txtva = price2num($txtva); // $txtva can have format '5.0(XXX)' or '5' } $txlocaltax1 = (float) price2num($txlocaltax1);