From 100607da1a540ea6dff535b3b130a8b1d44416ab Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Wed, 21 Oct 2009 09:51:52 +0000 Subject: [PATCH] Fix: functions "ereg", "ereg_replace", "eregi", "eregi_replace" is deprecated since php 5.3.0 --- htdocs/commande/fiche.php | 8 ++++---- htdocs/compta/facture.php | 8 ++++---- htdocs/compta/facture/impayees.php | 2 +- htdocs/compta/sociales/index.php | 2 +- htdocs/contrat/fiche.php | 4 ++-- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/htdocs/commande/fiche.php b/htdocs/commande/fiche.php index a12bf89bdcf..4ec8b03188e 100644 --- a/htdocs/commande/fiche.php +++ b/htdocs/commande/fiche.php @@ -389,8 +389,8 @@ if ($_POST['action'] == 'addline' && $user->rights->commande->creer) else { $pu_ht=$_POST['pu']; - $tva_tx=eregi_replace('\*','',$_POST['tva_tx']); - $tva_npr=eregi('\*',$_POST['tva_tx'])?1:0; + $tva_tx=str_replace('*','',$_POST['tva_tx']); + $tva_npr=preg_match('/\*/',$_POST['tva_tx'])?1:0; $desc=$_POST['dp_desc']; $type=$_POST["type"]; } @@ -470,11 +470,11 @@ if ($_POST['action'] == 'updateligne' && $user->rights->commande->creer && $_POS // Define info_bits $info_bits=0; - if (eregi('\*',$_POST['tva_tx'])) $info_bits |= 0x01; + if (preg_match('/\*/',$_POST['tva_tx'])) $info_bits |= 0x01; // Define vat_rate $vat_rate=$_POST['tva_tx']; - $vat_rate=eregi_replace('\*','',$vat_rate); + $vat_rate=str_replace('*','',$vat_rate); // Check parameters if (empty($_POST['productid']) && $_POST["type"] < 0) diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index 15c345ef85e..b0554d31c78 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -921,8 +921,8 @@ if (($_POST['action'] == 'addline' || $_POST['action'] == 'addline_predef') && $ else { $pu_ht=$_POST['pu']; - $tva_tx=eregi_replace('\*','',$_POST['tva_tx']); - $tva_npr=eregi('\*',$_POST['tva_tx'])?1:0; + $tva_tx=str_replace('*','',$_POST['tva_tx']); + $tva_npr=preg_match('/\*/',$_POST['tva_tx'])?1:0; $desc=$_POST['dp_desc']; $type=$_POST["type"]; } @@ -1002,11 +1002,11 @@ if ($_POST['action'] == 'updateligne' && $user->rights->facture->creer && $_POST // Define info_bits $info_bits=0; - if (eregi('\*',$_POST['tva_tx'])) $info_bits |= 0x01; + if (preg_match('/\*/',$_POST['tva_tx'])) $info_bits |= 0x01; // Define vat_rate $vat_rate=$_POST['tva_tx']; - $vat_rate=eregi_replace('\*','',$vat_rate); + $vat_rate=str_replace('*','',$vat_rate); // Check parameters if (empty($_POST['productid']) && $_POST["type"] < 0) diff --git a/htdocs/compta/facture/impayees.php b/htdocs/compta/facture/impayees.php index ee1acaf534d..f5bfdd723bc 100644 --- a/htdocs/compta/facture/impayees.php +++ b/htdocs/compta/facture/impayees.php @@ -246,7 +246,7 @@ if ($result) if ($_REQUEST["late"]) $param.='&late='.urlencode($_REQUEST["search_late"]); $urlsource=$_SERVER['PHP_SELF'].'?sortfield='.$sortfield.'&sortorder='.$sortorder; - $urlsource.=eregi_replace('&','&',$param); + $urlsource.=str_replace('&','&',$param); $titre=($socid?$langs->trans("BillsCustomersUnpaidForCompany",$soc->nom):$langs->trans("BillsCustomersUnpaid")); if ($option == 'late') $titre.=' ('.$langs->trans("Late").')'; diff --git a/htdocs/compta/sociales/index.php b/htdocs/compta/sociales/index.php index 61c31624d50..97fa57fabcc 100644 --- a/htdocs/compta/sociales/index.php +++ b/htdocs/compta/sociales/index.php @@ -53,7 +53,7 @@ $offset = $limit * $page ; if (empty($_REQUEST['typeid'])) { - $newfiltre=eregi_replace('filtre=','',$filtre); + $newfiltre=str_replace('filtre=','',$filtre); $filterarray=explode('-',$newfiltre); foreach($filterarray as $val) { diff --git a/htdocs/contrat/fiche.php b/htdocs/contrat/fiche.php index 726cc395f32..2701788cfd9 100644 --- a/htdocs/contrat/fiche.php +++ b/htdocs/contrat/fiche.php @@ -261,8 +261,8 @@ if ($_POST["action"] == 'addligne' && $user->rights->contrat->creer) { $pu_ht=$_POST['pu']; $price_base_type = 'HT'; - $tva_tx=eregi_replace('\*','',$_POST['tva_tx']); - $tva_npr=eregi('\*',$_POST['tva_tx'])?1:0; + $tva_tx=str_replace('*','',$_POST['tva_tx']); + $tva_npr=preg_match('/\*/',$_POST['tva_tx'])?1:0; $desc=$_POST['desc']; }