'.$langs->trans("Ref").' ';
print '';
if ($account)
{
- if (! eregi(',',$account))
+ if (! preg_match('/,/',$account))
{
$moreparam='&month='.$month.'&year='.$year.($mode=='showalltime'?'&mode=showalltime':'');
if ($_GET["option"]!='all')
diff --git a/htdocs/compta/bank/ligne.php b/htdocs/compta/bank/ligne.php
index 3004d934c88..371632dec97 100644
--- a/htdocs/compta/bank/ligne.php
+++ b/htdocs/compta/bank/ligne.php
@@ -312,7 +312,7 @@ if ($result)
{
print ' ';
print ' ';
- if (eregi('^\((.*)\)$',$objp->label,$reg))
+ if (preg_match('/^\((.*)\)$/i',$objp->label,$reg))
{
// Label generique car entre parentheses. On l'affiche en le traduisant
print $langs->trans($reg[1]);
diff --git a/htdocs/compta/bank/rappro.php b/htdocs/compta/bank/rappro.php
index 341e21dab5e..c1b14c06aef 100644
--- a/htdocs/compta/bank/rappro.php
+++ b/htdocs/compta/bank/rappro.php
@@ -145,7 +145,7 @@ if ($resql)
if ($mesg) print $mesg." ";
- // Affiche nom des derniers relevés
+ // Affiche nom des derniers relev�s
$nbmax=5;
$liste="";
@@ -230,7 +230,7 @@ if ($resql)
// Description
print ' ';
$reg=array();
- eregi('\((.+)\)',$objp->label,$reg); // Si texte entouré de parenthèe on tente recherche de traduction
+ preg_match('/\((.+)\)/i',$objp->label,$reg); // Si texte entoure de parenthee on tente recherche de traduction
if ($reg[1] && $langs->trans($reg[1])!=$reg[1]) print $langs->trans($reg[1]);
else print $objp->label;
print ' ';
@@ -300,9 +300,9 @@ if ($resql)
else {
//print ' - ';
print '';
- if (eregi('^\((.*)\)$',$links[$key]['label'],$reg))
+ if (preg_match('/^\((.*)\)$/i',$links[$key]['label'],$reg))
{
- // Label générique car entre parenthèses. On l'affiche en le traduisant
+ // Label generique car entre parentheses. On l'affiche en le traduisant
if ($reg[1]=='paiement') $reg[1]='Payment';
print $langs->trans($reg[1]);
}
@@ -327,12 +327,12 @@ if ($resql)
if ($objp->rappro)
{
- // Si ligne déjà rapprochée, on affiche relevé.
+ // Si ligne d�j� rapproch�e, on affiche relev�.
print " num_releve&account=$acct->id\">$objp->num_releve ";
}
else
{
- // Si pas encore rapprochée
+ // Si pas encore rapproch�e
if ($user->rights->banque->modifier)
{
print '';
@@ -347,7 +347,7 @@ if ($resql)
print '';
}
else {
- print " "; // On n'empeche la suppression car le raprochement ne pourra se faire qu'après la date passée et que l'écriture apparaisse bien sur le compte.
+ print " "; // On n'empeche la suppression car le raprochement ne pourra se faire qu'apr�s la date pass�e et que l'�criture apparaisse bien sur le compte.
}
print " ";
}
@@ -358,7 +358,7 @@ if ($resql)
}
- // Affiche zone saisie relevé + bouton "Rapprocher"
+ // Affiche zone saisie relev� + bouton "Rapprocher"
if ($objp->do <= gmmktime())
{
print '';
diff --git a/htdocs/compta/bank/releve.php b/htdocs/compta/bank/releve.php
index 69468fa0c7b..b5a6fbb6128 100644
--- a/htdocs/compta/bank/releve.php
+++ b/htdocs/compta/bank/releve.php
@@ -300,7 +300,7 @@ else
// Libelle
print ' ';
$reg=array();
- eregi('\((.+)\)',$objp->label,$reg); // Si texte entoure de parenthese on tente recherche de traduction
+ preg_match('/\((.+)\)/i',$objp->label,$reg); // Si texte entoure de parenthese on tente recherche de traduction
if ($reg[1] && $langs->trans($reg[1])!=$reg[1]) print $langs->trans($reg[1]);
else print $objp->label;
print ' ';
diff --git a/htdocs/compta/bank/search.php b/htdocs/compta/bank/search.php
index c9df6c9e546..c9ea98d1df8 100644
--- a/htdocs/compta/bank/search.php
+++ b/htdocs/compta/bank/search.php
@@ -189,7 +189,7 @@ if ($resql)
print "rowid&account=$objp->fk_account\">";
$reg=array();
- eregi('\((.+)\)',$objp->label,$reg); // Si texte entour� de parenth�e on tente recherche de traduction
+ preg_match('/\((.+)\)/i',$objp->label,$reg); // Si texte entoure de parenthee on tente recherche de traduction
if ($reg[1] && $langs->trans($reg[1])!=$reg[1]) print $langs->trans($reg[1]);
else print dol_trunc($objp->label,40);
print " ";
diff --git a/htdocs/compta/paiement/rapport.php b/htdocs/compta/paiement/rapport.php
index 621da00f1f0..b8f44d72f7f 100644
--- a/htdocs/compta/paiement/rapport.php
+++ b/htdocs/compta/paiement/rapport.php
@@ -127,7 +127,7 @@ print ' ';
clearstatcache();
-// Affiche lien sur autres ann�es
+// Affiche lien sur autres annees
$linkforyear=array();
$found=0;
if (is_dir($dir))
@@ -135,7 +135,7 @@ if (is_dir($dir))
$handle=opendir($dir);
while (($file = readdir($handle))!==false)
{
- if (is_dir($dir.'/'.$file) && ! eregi('^\.',$file))
+ if (is_dir($dir.'/'.$file) && ! preg_match('/^\./',$file))
{
$found=1;
$linkforyear[]=$file;
@@ -165,7 +165,7 @@ if ($year)
$var=true;
while (($file = readdir($handle))!==false)
{
- if (eregi('^payment',$file))
+ if (preg_match('/^payment/i',$file))
{
$var=!$var;
$tfile = $dir . '/'.$year.'/'.$file;
diff --git a/htdocs/compta/resultat/index.php b/htdocs/compta/resultat/index.php
index 5ccfad1387b..fa727b9d7c9 100644
--- a/htdocs/compta/resultat/index.php
+++ b/htdocs/compta/resultat/index.php
@@ -151,7 +151,7 @@ if ($modecompta != 'CREANCES-DETTES') {
$encaiss_ttc[$row->dm] += $row->amount_ttc;
// For DEBUG Only
- if (eregi('^2007',$row->dm))
+ if (preg_match('/^2007/',$row->dm))
{
$subtotal_ht = $subtotal_ht + $row->amount_ht;
$subtotal_ttc = $subtotal_ttc + $row->amount_ttc;
@@ -210,7 +210,7 @@ if ($result)
$decaiss_ttc[$row->dm] = $row->amount_ttc;
// For DEBUG Only
- if (eregi('^2007',$row->dm))
+ if (preg_match('/^2007/',$row->dm))
{
$subtotal_ht = $subtotal_ht + $row->amount_ht;
$subtotal_ttc = $subtotal_ttc + $row->amount_ttc;
@@ -311,7 +311,7 @@ else {
$decaiss[$obj->dm] += $obj->amount;
$decaiss_ttc[$obj->dm] += $obj->amount;
// For DEBUG Only
- if (eregi('^2007',$obj->dm))
+ if (preg_match('/^2007/',$obj->dm))
{
$subtotal_ht = $subtotal_ht + $obj->amount;
$subtotal_ttc = $subtotal_ttc + $obj->amount;
@@ -342,7 +342,7 @@ else {
$encaiss[$obj->dm] += $obj->amount;
$encaiss_ttc[$obj->dm] += $obj->amount;
// For DEBUG Only
- if (eregi('^2007',$obj->dm))
+ if (preg_match('/^2007/',$obj->dm))
{
$subtotal_ht = $subtotal_ht + $obj->amount;
$subtotal_ttc = $subtotal_ttc + $obj->amount;
@@ -410,7 +410,7 @@ if ($result) {
$decaiss_ttc[$obj->dm] += $obj->amount_ttc;
// For DEBUG Only
- if (eregi('^2007',$obj->dm))
+ if (preg_match('/^2007/',$obj->dm))
{
$subtotal_ht = $subtotal_ht + $obj->amount_ht;
$subtotal_ttc = $subtotal_ttc + $obj->amount_ttc;
@@ -478,7 +478,7 @@ if ($result) {
$decaiss_ttc[$obj->dm] += $obj->amount_ttc;
// For DEBUG Only
- if (eregi('^2007',$obj->dm))
+ if (preg_match('/^2007/',$obj->dm))
{
$subtotal_ht = $subtotal_ht + $obj->amount_ht;
$subtotal_ttc = $subtotal_ttc + $obj->amount_ttc;
diff --git a/htdocs/core/conf.class.php b/htdocs/core/conf.class.php
index 3654703ef48..0fd8976ed09 100644
--- a/htdocs/core/conf.class.php
+++ b/htdocs/core/conf.class.php
@@ -109,12 +109,12 @@ class Conf
if (! defined("$key")) define ("$key", $value); // In some cases, the constant might be already forced (Example: SYSLOG_FILE during install)
$this->global->$key=$value;
// If this is constant for a css file activated by a module
- if (eregi('^MAIN_MODULE_([A-Z_]+)_CSS$',$key) && $value)
+ if (preg_match('/^MAIN_MODULE_([A-Z_]+)_CSS$/i',$key) && $value)
{
$this->css_modules[]=$value;
}
// If this is constant for a new tab page activated by a module
- if (eregi('^MAIN_MODULE_([A-Z_]+)_TABS_',$key) && $value)
+ if (preg_match('/^MAIN_MODULE_([A-Z_]+)_TABS_/i',$key) && $value)
{
$params=explode(':',$value,2);
$this->tabs_modules[$params[0]][]=$value;
@@ -122,18 +122,18 @@ class Conf
}
// If this is constant to force a module directories (used to manage some exceptions)
// Should not be used by modules
- if (eregi('^MAIN_MODULE_([A-Z_]+)_DIR_',$key,$reg) && $value)
+ if (preg_match('/^MAIN_MODULE_([A-Z_]+)_DIR_/i',$key,$reg) && $value)
{
$module=strtolower($reg[1]);
// If with submodule name
- if (eregi('_DIR_([A-Z_]+)?_([A-Z]+)$',$key,$reg))
+ if (preg_match('/_DIR_([A-Z_]+)?_([A-Z]+)$/i',$key,$reg))
{
$dir_name = "dir_".strtolower($reg[2]);
$submodule = strtolower($reg[1]);
$this->$module->$submodule->$dir_name = $value; // We put only dir name. We will add DOL_DATA_ROOT later
//print '->'.$module.'->'.$submodule.'->'.$dir_name.' = '.$this->$module->$submodule->$dir_name.' ';
}
- else if (eregi('_DIR_([A-Z]+)$',$key,$reg))
+ else if (preg_match('/_DIR_([A-Z]+)$/i',$key,$reg))
{
$dir_name = "dir_".strtolower($reg[1]);
$this->$module->$dir_name = $value; // We put only dir name. We will add DOL_DATA_ROOT later
@@ -141,14 +141,14 @@ class Conf
}
}
// If this is constant for a smarty need by a module
- if (eregi('^MAIN_MODULE_([A-Z_]+)_NEEDSMARTY$',$key) && $value)
+ if (preg_match('/^MAIN_MODULE_([A-Z_]+)_NEEDSMARTY$/i',$key) && $value)
{
$module=strtolower($reg[1]);
// Add this module in list of modules that need smarty
$this->need_smarty[]=$module;
}
// If this is a module constant
- if (eregi('^MAIN_MODULE_([A-Z]+)$',$key,$reg) && $value)
+ if (preg_match('/^MAIN_MODULE_([A-Z]+)$/i',$key,$reg) && $value)
{
$module=strtolower($reg[1]);
//print "Module ".$module." is enabled \n";
diff --git a/htdocs/core/menubase.class.php b/htdocs/core/menubase.class.php
index 22951118e81..52ca1de6d7f 100644
--- a/htdocs/core/menubase.class.php
+++ b/htdocs/core/menubase.class.php
@@ -392,7 +392,7 @@ class Menubase
$title = $langs->trans($menu['titre']);
$langs->load($menu['langs']);
}
- if (eregi("/",$title))
+ if (preg_match("/\//",$title))
{
$tab_titre = explode("/",$title);
$chaine = $langs->trans($tab_titre[0])."/".$langs->trans($tab_titre[1]);
@@ -424,9 +424,9 @@ class Menubase
$tabMenu[$b][0] = $menu['rowid'];
$tabMenu[$b][1] = $menu['fk_menu'];
$tabMenu[$b][2] = $menu['url'];
- if (! eregi("^(http:\/\/|https:\/\/)",$tabMenu[$b][2]))
+ if (! preg_match("/^(http:\/\/|https:\/\/)/i",$tabMenu[$b][2]))
{
- if (eregi('\?',$tabMenu[$b][2])) $tabMenu[$b][2].='&idmenu='.$menu['rowid'];
+ if (preg_match('/\?/',$tabMenu[$b][2])) $tabMenu[$b][2].='&idmenu='.$menu['rowid'];
else $tabMenu[$b][2].='?idmenu='.$menu['rowid'];
}
$tabMenu[$b][3] = $chaine;
@@ -500,7 +500,7 @@ class Menubase
{
// print "x".$pere." ".$tab[$x][6];
- $this->newmenu->add((! eregi("^(http:\/\/|https:\/\/)",$tab[$x][2])) ? DOL_URL_ROOT . $tab[$x][2] : $tab[$x][2], $tab[$x][3], $rang -1, $tab[$x][4], $tab[$x][5]);
+ $this->newmenu->add((! preg_match("/^(http:\/\/|https:\/\/)/i",$tab[$x][2])) ? DOL_URL_ROOT . $tab[$x][2] : $tab[$x][2], $tab[$x][3], $rang -1, $tab[$x][4], $tab[$x][5]);
$this->recur($tab, $tab[$x][0], $rang +1);
}
}
@@ -622,7 +622,7 @@ class Menubase
$langs->load($objm->langs);
}
- if (eregi("/",$title))
+ if (preg_match("/\//",$title))
{
$tab_titre = explode("/",$title);
$chaine = $langs->trans($tab_titre[0])."/".$langs->trans($tab_titre[1]);
diff --git a/htdocs/ecm/index.php b/htdocs/ecm/index.php
index 31e2ff42ef8..80f85e27840 100644
--- a/htdocs/ecm/index.php
+++ b/htdocs/ecm/index.php
@@ -238,7 +238,7 @@ print '';
print '';
-if (empty($action) || $action == 'file_manager' || eregi('refresh',$action) || $action == 'delete')
+if (empty($action) || $action == 'file_manager' || preg_match('/refresh/i',$action) || $action == 'delete')
{
$userstatic = new User($db);
$ecmdirstatic = new ECMDirectory($db);
@@ -451,7 +451,7 @@ if (empty($action) || $action == 'file_manager' || eregi('refresh',$action) || $
$ecmdirstatic->ref=$val['label'];
// Refresh cache
- if (eregi('refresh',$_GET['action']))
+ if (preg_match('/refresh/i',$_GET['action']))
{
$result=$ecmdirstatic->fetch($val['id']);
$ecmdirstatic->ref=$ecmdirstatic->label;
@@ -470,7 +470,7 @@ if (empty($action) || $action == 'file_manager' || eregi('refresh',$action) || $
// If directory is brother of selected directory, we show line
elseif ($val['id'] != $section && $val['id_mere'] == $ecmdirstatic->motherof[$section]) $showline=3;
// If directory is parent of selected directory or is selected directory, we show line
- elseif (eregi($val['fullpath'].'_',$fullpathselected.'_')) $showline=2;
+ elseif (preg_match('/'.$val['fullpath'].'_/i',$fullpathselected.'_')) $showline=2;
// If we are level one we show line
elseif ($val['level'] < 2) $showline=1;
@@ -604,7 +604,7 @@ print ' ';
// Actions buttons
print '';
-if (empty($action) || $action == 'file_manager' || eregi('refresh',$action))
+if (empty($action) || $action == 'file_manager' || preg_match('/refresh/i',$action))
{
if ($user->rights->ecm->setup)
{
diff --git a/htdocs/fourn/commande/dispatch.php b/htdocs/fourn/commande/dispatch.php
index 6296888dd94..7e5a6f0e25b 100644
--- a/htdocs/fourn/commande/dispatch.php
+++ b/htdocs/fourn/commande/dispatch.php
@@ -61,7 +61,7 @@ if ($_POST["action"] == 'dispatch' && $user->rights->fournisseur->commande->rece
foreach($_POST as $key => $value)
{
- if ( eregi('^product_([0-9]+)$', $key, $reg) )
+ if ( preg_match('/^product_([0-9]+)$/i', $key, $reg) )
{
$prod = "product_".$reg[1];
$qty = "qty_".$reg[1];
diff --git a/htdocs/fourn/commande/fiche.php b/htdocs/fourn/commande/fiche.php
index 961c1696012..a809c5cb182 100644
--- a/htdocs/fourn/commande/fiche.php
+++ b/htdocs/fourn/commande/fiche.php
@@ -532,7 +532,7 @@ if ($id > 0 || ! empty($ref))
$commande->date_commande=gmmktime();
// We check if number is temporary number
- if (eregi('^\(PROV',$commande->ref)) $newref = $commande->getNextNumRef($soc);
+ if (preg_match('/^\(PROV/i',$commande->ref)) $newref = $commande->getNextNumRef($soc);
else $newref = $commande->ref;
$text=$langs->trans('ConfirmValidateOrder',$newref);
diff --git a/htdocs/fourn/facture/paiementfourn.class.php b/htdocs/fourn/facture/paiementfourn.class.php
index c99d671a23b..8af057bbbab 100644
--- a/htdocs/fourn/facture/paiementfourn.class.php
+++ b/htdocs/fourn/facture/paiementfourn.class.php
@@ -484,7 +484,7 @@ class PaiementFourn
$lienfin='';
$text=$this->ref; // Sometimes ref contains label
- if (eregi('^\((.*)\)$',$text,$reg))
+ if (preg_match('/^\((.*)\)$/i',$text,$reg))
{
// Label g诩rique car entre parenth粥s. On l'affiche en le traduisant
if ($reg[1]=='paiement') $reg[1]='Payment';
diff --git a/htdocs/fourn/fournisseur.commande.class.php b/htdocs/fourn/fournisseur.commande.class.php
index 6a13a9f1f45..0e0ef024153 100644
--- a/htdocs/fourn/fournisseur.commande.class.php
+++ b/htdocs/fourn/fournisseur.commande.class.php
@@ -246,7 +246,7 @@ class CommandeFournisseur extends Commande
$soc->fetch($this->fourn_id);
// Check if object has a temporary ref
- if (eregi('^\(PROV', $this->ref))
+ if (preg_match('/^\(PROV/i', $this->ref))
{
$num = $this->getNextNumRef($soc);
}
diff --git a/htdocs/imports/import.php b/htdocs/imports/import.php
index 854d7fb10b4..0497875631d 100644
--- a/htdocs/imports/import.php
+++ b/htdocs/imports/import.php
@@ -561,7 +561,7 @@ if ($step == 3 && $datatoimport)
// readdir return value in ISO and we want UTF8 in memory
if (! utf8_check($file)) $file=utf8_encode($file);
- if (eregi('^\.',$file)) continue;
+ if (preg_match('/^\./',$file)) continue;
$modulepart='import';
$urlsource=$_SERVER["PHP_SELF"].'?step='.$step.$param.'&filetoimport='.urlencode($filetoimport);
@@ -841,10 +841,10 @@ if ($step == 4 && $datatoimport)
print ' =>'.img_object('',$entityicon).' '.$langs->trans($entitylang).' ';
print '';
- $newlabel=preg_replace('/\*$/i','',$label);
+ $newlabel=preg_replace('/\*$/','',$label);
$text=$langs->trans($newlabel);
$more='';
- if (eregi('\*$',$label))
+ if (preg_match('/\*$/',$label))
{
$text=''.$text.'* ';
$more=((! empty($valforsourcefieldnb[$i]) && $valforsourcefieldnb[$i] <= sizeof($fieldssource)) ? '' : img_warning($langs->trans("FieldNeedSource")));
@@ -853,7 +853,7 @@ if ($step == 4 && $datatoimport)
}
$htmltext =$langs->trans("Table").": ".$tablename." ";
$htmltext.=$langs->trans("Field").': '.$code." ";
- $htmltext.=$langs->trans("Required").': '.yn(eregi('\*$',$label)).' ';
+ $htmltext.=$langs->trans("Required").': '.yn(preg_match('/\*$/',$label)).' ';
$note=$objimport->array_import_examplevalues[0][$code];
if ($note) $htmltext.=' '.$langs->trans("Note").'/'.$langs->trans("Example").': '.$note;
$text.=$more;
diff --git a/htdocs/includes/barcode/php-barcode/encode_bars.php b/htdocs/includes/barcode/php-barcode/encode_bars.php
index c1fb5f0e7a8..c8ec8c5a026 100644
--- a/htdocs/includes/barcode/php-barcode/encode_bars.php
+++ b/htdocs/includes/barcode/php-barcode/encode_bars.php
@@ -47,7 +47,7 @@ function barcode_encode_ean($ean, $encoding = "EAN-13"){
$guards=array("9a1a","1a1a1","a1a");
$ean=trim($ean);
- if (eregi("[^0-9]",$ean)){
+ if (preg_match("/[^0-9]/i",$ean)){
return array("text"=>"Invalid EAN-Code");
}
$encoding=strtoupper($encoding);
diff --git a/htdocs/includes/barcode/php-barcode/php-barcode.php b/htdocs/includes/barcode/php-barcode/php-barcode.php
index 19e9cf6beef..e370cda983c 100644
--- a/htdocs/includes/barcode/php-barcode/php-barcode.php
+++ b/htdocs/includes/barcode/php-barcode/php-barcode.php
@@ -342,7 +342,7 @@ function barcode_outhtml($code, $bars, $scale = 1, $total_y = 0, $space = ''){
function barcode_encode_genbarcode($code,$encoding){
global $genbarcode_loc;
/* delete EAN-13 checksum */
- if (eregi("^ean$", $encoding) && strlen($code)==13) $code=substr($code,0,12);
+ if (preg_match("/^ean$/i", $encoding) && strlen($code)==13) $code=substr($code,0,12);
if (!$encoding) $encoding="ANY";
$encoding=preg_replace("/[|\\]/", "_", $encoding);
$code=preg_replace("/[|\\]/", "_", $code);
@@ -398,12 +398,12 @@ function barcode_encode($code,$encoding){
((preg_match("/^ean$/i", $encoding)
&& ( strlen($code)==12 || strlen($code)==13)))
- || (($encoding) && (eregi("^isbn$", $encoding))
+ || (($encoding) && (preg_match("/^isbn$/i", $encoding))
&& (( strlen($code)==9 || strlen($code)==10) ||
(((preg_match("/^978/", $code) && strlen($code)==12) ||
(strlen($code)==13)))))
- || (( !isset($encoding) || !$encoding || (eregi("^ANY$", $encoding) ))
+ || (( !isset($encoding) || !$encoding || (preg_match("/^ANY$/i", $encoding) ))
&& (preg_match("/^[0-9]{12,13}$/", $code)))
){
@@ -445,8 +445,8 @@ function barcode_print($code, $encoding="ANY", $scale = 2 ,$mode = "png" ){
$bars=barcode_encode($code,$encoding);
if (!$bars) return;
if (!$mode) $mode="png";
- if (eregi($mode,"^(text|txt|plain)$")) print barcode_outtext($bars['text'],$bars['bars']);
- elseif (eregi($mode,"^(html|htm)$")) print barcode_outhtml($bars['text'],$bars['bars'], $scale,0, 0);
+ if (preg_match("/^(text|txt|plain)$/i",$mode)) print barcode_outtext($bars['text'],$bars['bars']);
+ elseif (preg_match("/^(html|htm)$/i",$mode)) print barcode_outhtml($bars['text'],$bars['bars'], $scale,0, 0);
else barcode_outimage($bars['text'],$bars['bars'],$scale, $mode);
return $bars;
}
diff --git a/htdocs/includes/fpdf/fpdf/fpdf.php b/htdocs/includes/fpdf/fpdf/fpdf.php
index 3cfb11eef1f..cfb4a398dfb 100644
--- a/htdocs/includes/fpdf/fpdf/fpdf.php
+++ b/htdocs/includes/fpdf/fpdf/fpdf.php
@@ -2292,13 +2292,13 @@ function _enddoc()
}
case 'span': {
if (isset($attr['style']) && $attr['style']!='') {
- if (eregi("color",$attr['style'])){
- if (eregi("rgb",$attr['style'])){
+ if (preg_match("/color/i",$attr['style'])){
+ if (preg_match("/rgb/i",$attr['style'])){
//print 'style rgb '.$attr['style'].' ';
$coul = substr($attr['style'],11,-2);
list($R, $G, $B) = explode(', ', $coul);
}
- else if (eregi("#",$attr['style'])){
+ else if (preg_match("/#/",$attr['style'])){
//print 'style hexa '.$attr['style'].' ';
$R = hexdec(substr($attr['style'],8,2));
$G = hexdec(substr($attr['style'],10,2));
@@ -2308,7 +2308,7 @@ function _enddoc()
$this->SetTextColor($R,$G,$B);
$this->issetcolor=true;
}
- if (eregi("font-family",$attr['style'])){
+ if (preg_match("/font-family/i",$attr['style'])){
$fontName = substr($attr['style'],13,-1);
$fontName = $this->convertNameFont($fontName);
if (isset($fontName) && in_array(strtolower($fontName), $this->fontlist)) {
@@ -2317,7 +2317,7 @@ function _enddoc()
//print 'fontfamily: '.$this->FontFamily.' ';
}
}
- if (eregi("font-size",$attr['style'])){
+ if (preg_match("/font-size/i",$attr['style'])){
$headsize = substr($attr['style'],11);
$headsize = preg_replace('/[;-]/','',$headsize);
//print 'headsize1: '.$headsize.' ';
diff --git a/htdocs/includes/menus/barre_left/auguria_backoffice.php b/htdocs/includes/menus/barre_left/auguria_backoffice.php
index c8c9072aa0f..d352d542981 100644
--- a/htdocs/includes/menus/barre_left/auguria_backoffice.php
+++ b/htdocs/includes/menus/barre_left/auguria_backoffice.php
@@ -158,9 +158,9 @@ class MenuLeft {
// Add mainmenu in GET url. This make to go back on correct menu even when using Back on browser.
$url=$this->menu_array[$i]['url'];
- if (! eregi('mainmenu=',$this->menu_array[$i]['url']))
+ if (! preg_match('/mainmenu=/i',$this->menu_array[$i]['url']))
{
- if (! eregi('\?',$url)) $url.='?';
+ if (! preg_match('/\?/',$url)) $url.='?';
else $url.='&';
$url.='mainmenu='.$mainmenu;
}
diff --git a/htdocs/includes/menus/barre_left/auguria_frontoffice.php b/htdocs/includes/menus/barre_left/auguria_frontoffice.php
index 7038552be1f..db3cfd89d72 100644
--- a/htdocs/includes/menus/barre_left/auguria_frontoffice.php
+++ b/htdocs/includes/menus/barre_left/auguria_frontoffice.php
@@ -158,9 +158,9 @@ class MenuLeft {
// Add mainmenu in GET url. This make to go back on correct menu even when using Back on browser.
$url=$this->menu_array[$i]['url'];
- if (! eregi('mainmenu=',$this->menu_array[$i]['url']))
+ if (! preg_match('/mainmenu=/i',$this->menu_array[$i]['url']))
{
- if (! eregi('\?',$url)) $url.='?';
+ if (! preg_match('/\?/',$url)) $url.='?';
else $url.='&';
$url.='mainmenu='.$mainmenu;
}
diff --git a/htdocs/includes/menus/barre_left/eldy_backoffice.php b/htdocs/includes/menus/barre_left/eldy_backoffice.php
index 9053d589759..bcf42a09e8b 100644
--- a/htdocs/includes/menus/barre_left/eldy_backoffice.php
+++ b/htdocs/includes/menus/barre_left/eldy_backoffice.php
@@ -429,21 +429,21 @@ class MenuLeft {
$newmenu->add(DOL_URL_ROOT."/compta/facture.php?leftmenu=customers_bills",$langs->trans("BillsCustomers"),1,$user->rights->facture->lire);
if ($user->societe_id == 0)
{
- if (eregi("customers_bills",$leftmenu)) $newmenu->add(DOL_URL_ROOT."/compta/clients.php?action=facturer&leftmenu=customers_bills",$langs->trans("NewBill"),2,$user->rights->facture->creer);
+ if (preg_match("/customers_bills/i",$leftmenu)) $newmenu->add(DOL_URL_ROOT."/compta/clients.php?action=facturer&leftmenu=customers_bills",$langs->trans("NewBill"),2,$user->rights->facture->creer);
}
- if (eregi("customers_bills",$leftmenu)) $newmenu->add(DOL_URL_ROOT."/compta/facture/fiche-rec.php?leftmenu=customers_bills",$langs->trans("Repeatables"),2,$user->rights->facture->lire);
+ if (preg_match("/customers_bills/i",$leftmenu)) $newmenu->add(DOL_URL_ROOT."/compta/facture/fiche-rec.php?leftmenu=customers_bills",$langs->trans("Repeatables"),2,$user->rights->facture->lire);
- if (eregi("customers_bills",$leftmenu)) $newmenu->add(DOL_URL_ROOT."/compta/facture/impayees.php?leftmenu=customers_bills",$langs->trans("Unpaid"),2,$user->rights->facture->lire);
+ if (preg_match("/customers_bills/i",$leftmenu)) $newmenu->add(DOL_URL_ROOT."/compta/facture/impayees.php?leftmenu=customers_bills",$langs->trans("Unpaid"),2,$user->rights->facture->lire);
- if (eregi("customers_bills",$leftmenu)) $newmenu->add(DOL_URL_ROOT."/compta/paiement/liste.php?leftmenu=customers_bills_payments",$langs->trans("Payments"),2,$user->rights->facture->lire);
+ if (preg_match("/customers_bills/i",$leftmenu)) $newmenu->add(DOL_URL_ROOT."/compta/paiement/liste.php?leftmenu=customers_bills_payments",$langs->trans("Payments"),2,$user->rights->facture->lire);
if ($conf->global->BILL_ADD_PAYMENT_VALIDATION)
{
- if (eregi("customers_bills_payments",$leftmenu)) $newmenu->add(DOL_URL_ROOT."/compta/paiement/avalider.php?leftmenu=customers_bills_payments",$langs->trans("MenuToValid"),3,$user->rights->facture->lire);
+ if (preg_match("/customers_bills_payments/i",$leftmenu)) $newmenu->add(DOL_URL_ROOT."/compta/paiement/avalider.php?leftmenu=customers_bills_payments",$langs->trans("MenuToValid"),3,$user->rights->facture->lire);
}
- if (eregi("customers_bills_payments",$leftmenu)) $newmenu->add(DOL_URL_ROOT."/compta/paiement/rapport.php?leftmenu=customers_bills_payments",$langs->trans("Reportings"),3,$user->rights->facture->lire);
+ if (preg_match("/customers_bills_payments/i",$leftmenu)) $newmenu->add(DOL_URL_ROOT."/compta/paiement/rapport.php?leftmenu=customers_bills_payments",$langs->trans("Reportings"),3,$user->rights->facture->lire);
- if (eregi("customers_bills",$leftmenu)) $newmenu->add(DOL_URL_ROOT."/compta/facture/stats/index.php?leftmenu=customers_bills", $langs->trans("Statistics"),2,$user->rights->facture->lire);
+ if (preg_match("/customers_bills/i",$leftmenu)) $newmenu->add(DOL_URL_ROOT."/compta/facture/stats/index.php?leftmenu=customers_bills", $langs->trans("Statistics"),2,$user->rights->facture->lire);
}
// Proposals
@@ -484,17 +484,17 @@ class MenuLeft {
if ($conf->tax->enabled)
{
$newmenu->add(DOL_URL_ROOT."/compta/charges/index.php?leftmenu=tax&mainmenu=accountancy",$langs->trans("MenuTaxAndDividends"), 0, $user->rights->tax->charges->lire);
- if (eregi('^tax',$leftmenu)) $newmenu->add(DOL_URL_ROOT."/compta/charges/index.php?leftmenu=tax_social&mainmenu=accountancy&mode=sconly",$langs->trans("MenuSocialContributions"),1,$user->rights->tax->charges->lire);
- if (eregi('^tax',$leftmenu)) $newmenu->add(DOL_URL_ROOT."/compta/sociales/charges.php?leftmenu=tax_social&action=create",$langs->trans("MenuNewSocialContribution"), 2, $user->rights->tax->charges->creer);
- if (eregi('^tax',$leftmenu)) $newmenu->add(DOL_URL_ROOT."/compta/sociales/index.php?leftmenu=tax_social",$langs->trans("List"), 2, $user->rights->tax->charges->lire);
+ if (preg_match('/^tax/i',$leftmenu)) $newmenu->add(DOL_URL_ROOT."/compta/charges/index.php?leftmenu=tax_social&mainmenu=accountancy&mode=sconly",$langs->trans("MenuSocialContributions"),1,$user->rights->tax->charges->lire);
+ if (preg_match('/^tax/i',$leftmenu)) $newmenu->add(DOL_URL_ROOT."/compta/sociales/charges.php?leftmenu=tax_social&action=create",$langs->trans("MenuNewSocialContribution"), 2, $user->rights->tax->charges->creer);
+ if (preg_match('/^tax/i',$leftmenu)) $newmenu->add(DOL_URL_ROOT."/compta/sociales/index.php?leftmenu=tax_social",$langs->trans("List"), 2, $user->rights->tax->charges->lire);
// VAT
if ($conf->compta->tva)
{
- if (eregi('^tax',$leftmenu)) $newmenu->add(DOL_URL_ROOT."/compta/tva/index.php?leftmenu=tax_vat&mainmenu=accountancy",$langs->trans("VAT"),1,$user->rights->tax->charges->lire);
- if (eregi('^tax',$leftmenu)) $newmenu->add(DOL_URL_ROOT."/compta/tva/fiche.php?leftmenu=tax_vat&action=create",$langs->trans("NewPayment"),2,$user->rights->tax->charges->creer);
- if (eregi('^tax',$leftmenu)) $newmenu->add(DOL_URL_ROOT."/compta/tva/reglement.php?leftmenu=tax_vat",$langs->trans("List"),2,$user->rights->tax->charges->lire);
- if (eregi('^tax',$leftmenu)) $newmenu->add(DOL_URL_ROOT."/compta/tva/clients.php?leftmenu=tax_vat", $langs->trans("ReportByCustomers"), 2, $user->rights->tax->charges->lire);
- if (eregi('^tax',$leftmenu)) $newmenu->add(DOL_URL_ROOT."/compta/tva/quadri_detail.php?leftmenu=tax_vat", $langs->trans("ReportByQuarter"), 2, $user->rights->tax->charges->lire);
+ if (preg_match('/^tax/i',$leftmenu)) $newmenu->add(DOL_URL_ROOT."/compta/tva/index.php?leftmenu=tax_vat&mainmenu=accountancy",$langs->trans("VAT"),1,$user->rights->tax->charges->lire);
+ if (preg_match('/^tax/i',$leftmenu)) $newmenu->add(DOL_URL_ROOT."/compta/tva/fiche.php?leftmenu=tax_vat&action=create",$langs->trans("NewPayment"),2,$user->rights->tax->charges->creer);
+ if (preg_match('/^tax/i',$leftmenu)) $newmenu->add(DOL_URL_ROOT."/compta/tva/reglement.php?leftmenu=tax_vat",$langs->trans("List"),2,$user->rights->tax->charges->lire);
+ if (preg_match('/^tax/i',$leftmenu)) $newmenu->add(DOL_URL_ROOT."/compta/tva/clients.php?leftmenu=tax_vat", $langs->trans("ReportByCustomers"), 2, $user->rights->tax->charges->lire);
+ if (preg_match('/^tax/i',$leftmenu)) $newmenu->add(DOL_URL_ROOT."/compta/tva/quadri_detail.php?leftmenu=tax_vat", $langs->trans("ReportByQuarter"), 2, $user->rights->tax->charges->lire);
}
}
@@ -545,8 +545,8 @@ class MenuLeft {
if ($conf->facture->enabled && $conf->banque->enabled)
{
$newmenu->add(DOL_URL_ROOT."/compta/paiement/cheque/index.php?leftmenu=checks",$langs->trans("MenuChequeDeposits"),0,$user->rights->banque->cheque);
- if (eregi("checks",$leftmenu)) $newmenu->add(DOL_URL_ROOT."/compta/paiement/cheque/fiche.php?leftmenu=checks&action=new",$langs->trans("NewChequeDeposit"),1,$user->rights->banque->cheque);
- if (eregi("checks",$leftmenu)) $newmenu->add(DOL_URL_ROOT."/compta/paiement/cheque/liste.php?leftmenu=checks",$langs->trans("MenuChequesReceipts"),1,$user->rights->banque->cheque);
+ if (preg_match("/checks/i",$leftmenu)) $newmenu->add(DOL_URL_ROOT."/compta/paiement/cheque/fiche.php?leftmenu=checks&action=new",$langs->trans("NewChequeDeposit"),1,$user->rights->banque->cheque);
+ if (preg_match("/checks/i",$leftmenu)) $newmenu->add(DOL_URL_ROOT."/compta/paiement/cheque/liste.php?leftmenu=checks",$langs->trans("MenuChequesReceipts"),1,$user->rights->banque->cheque);
}
// Bank-Caisse
@@ -851,8 +851,8 @@ class MenuLeft {
{
$langs->load("bills");
$newmenu->add(DOL_URL_ROOT."/compta/paiement/cheque/index.php?leftmenu=members_checks",$langs->trans("MenuChequeDeposits"),0,$user->rights->adherent->cotisation->lire);
- if (eregi("members_checks",$leftmenu)) $newmenu->add(DOL_URL_ROOT."/compta/paiement/cheque/fiche.php?leftmenu=members_checks&action=new",$langs->trans("NewChequeDeposit"),1,$user->rights->adherent->cotisation->creer);
- if (eregi("members_checks",$leftmenu)) $newmenu->add(DOL_URL_ROOT."/compta/paiement/cheque/liste.php?leftmenu=members_checks",$langs->trans("MenuChequesReceipts"),1,$user->rights->adherent->cotisation->lire);
+ if (preg_match("/members_checks/i",$leftmenu)) $newmenu->add(DOL_URL_ROOT."/compta/paiement/cheque/fiche.php?leftmenu=members_checks&action=new",$langs->trans("NewChequeDeposit"),1,$user->rights->adherent->cotisation->creer);
+ if (preg_match("/members_checks/i",$leftmenu)) $newmenu->add(DOL_URL_ROOT."/compta/paiement/cheque/liste.php?leftmenu=members_checks",$langs->trans("MenuChequesReceipts"),1,$user->rights->adherent->cotisation->lire);
}
if ($conf->banque->enabled)
diff --git a/htdocs/includes/menus/barre_left/eldy_frontoffice.php b/htdocs/includes/menus/barre_left/eldy_frontoffice.php
index 0e007014775..31961e70aba 100644
--- a/htdocs/includes/menus/barre_left/eldy_frontoffice.php
+++ b/htdocs/includes/menus/barre_left/eldy_frontoffice.php
@@ -436,22 +436,22 @@ class MenuLeft {
$newmenu->add(DOL_URL_ROOT."/compta/facture.php?leftmenu=customers_bills",$langs->trans("BillsCustomers"),1,$user->rights->facture->lire);
if ($user->societe_id == 0)
{
- if (eregi("customers_bills",$leftmenu)) $newmenu->add(DOL_URL_ROOT."/compta/clients.php?action=facturer&leftmenu=customers_bills",$langs->trans("NewBill"),2,$user->rights->facture->creer);
+ if (preg_match("/customers_bills/i",$leftmenu)) $newmenu->add(DOL_URL_ROOT."/compta/clients.php?action=facturer&leftmenu=customers_bills",$langs->trans("NewBill"),2,$user->rights->facture->creer);
}
- if (eregi("customers_bills",$leftmenu)) $newmenu->add(DOL_URL_ROOT."/compta/facture/fiche-rec.php?leftmenu=customers_bills",$langs->trans("Repeatables"),2,$user->rights->facture->lire);
+ if (preg_match("/customers_bills/i",$leftmenu)) $newmenu->add(DOL_URL_ROOT."/compta/facture/fiche-rec.php?leftmenu=customers_bills",$langs->trans("Repeatables"),2,$user->rights->facture->lire);
- if (eregi("customers_bills",$leftmenu)) $newmenu->add(DOL_URL_ROOT."/compta/facture/impayees.php?leftmenu=customers_bills",$langs->trans("Unpaid"),2,$user->rights->facture->lire);
+ if (preg_match("/customers_bills/i",$leftmenu)) $newmenu->add(DOL_URL_ROOT."/compta/facture/impayees.php?leftmenu=customers_bills",$langs->trans("Unpaid"),2,$user->rights->facture->lire);
- if (eregi("customers_bills",$leftmenu)) $newmenu->add(DOL_URL_ROOT."/compta/paiement/liste.php?leftmenu=customers_bills_payments",$langs->trans("Payments"),2,$user->rights->facture->lire);
+ if (preg_match("/customers_bills/i",$leftmenu)) $newmenu->add(DOL_URL_ROOT."/compta/paiement/liste.php?leftmenu=customers_bills_payments",$langs->trans("Payments"),2,$user->rights->facture->lire);
if ($conf->global->BILL_ADD_PAYMENT_VALIDATION)
{
- if (eregi("customers_bills_payments",$leftmenu)) $newmenu->add(DOL_URL_ROOT."/compta/paiement/avalider.php?leftmenu=customers_bills_payments",$langs->trans("MenuToValid"),3,$user->rights->facture->lire);
+ if (preg_match("/customers_bills_payments/i",$leftmenu)) $newmenu->add(DOL_URL_ROOT."/compta/paiement/avalider.php?leftmenu=customers_bills_payments",$langs->trans("MenuToValid"),3,$user->rights->facture->lire);
}
- if (eregi("customers_bills_payments",$leftmenu)) $newmenu->add(DOL_URL_ROOT."/compta/paiement/rapport.php?leftmenu=customers_bills_payments",$langs->trans("Reportings"),3,$user->rights->facture->lire);
+ if (preg_match("/customers_bills_payments/i",$leftmenu)) $newmenu->add(DOL_URL_ROOT."/compta/paiement/rapport.php?leftmenu=customers_bills_payments",$langs->trans("Reportings"),3,$user->rights->facture->lire);
- if (eregi("customers_bills",$leftmenu)) $newmenu->add(DOL_URL_ROOT."/compta/facture/stats/index.php?leftmenu=customers_bills", $langs->trans("Statistics"),2,$user->rights->facture->lire);
+ if (preg_match("/customers_bills/i",$leftmenu)) $newmenu->add(DOL_URL_ROOT."/compta/facture/stats/index.php?leftmenu=customers_bills", $langs->trans("Statistics"),2,$user->rights->facture->lire);
}
// Proposals
@@ -492,17 +492,17 @@ class MenuLeft {
if ($conf->tax->enabled)
{
$newmenu->add(DOL_URL_ROOT."/compta/charges/index.php?leftmenu=tax&mainmenu=accountancy",$langs->trans("MenuTaxAndDividends"), 0, $user->rights->tax->charges->lire);
- if (eregi('^tax',$leftmenu)) $newmenu->add(DOL_URL_ROOT."/compta/charges/index.php?leftmenu=tax_social&mainmenu=accountancy&mode=sconly",$langs->trans("MenuSocialContributions"),1,$user->rights->tax->charges->lire);
- if (eregi('^tax',$leftmenu)) $newmenu->add(DOL_URL_ROOT."/compta/sociales/charges.php?leftmenu=tax_social&action=create",$langs->trans("MenuNewSocialContribution"), 2, $user->rights->tax->charges->creer);
- if (eregi('^tax',$leftmenu)) $newmenu->add(DOL_URL_ROOT."/compta/sociales/index.php?leftmenu=tax_social",$langs->trans("List"), 2, $user->rights->tax->charges->lire);
+ if (preg_match('/^tax/i',$leftmenu)) $newmenu->add(DOL_URL_ROOT."/compta/charges/index.php?leftmenu=tax_social&mainmenu=accountancy&mode=sconly",$langs->trans("MenuSocialContributions"),1,$user->rights->tax->charges->lire);
+ if (preg_match('/^tax/i',$leftmenu)) $newmenu->add(DOL_URL_ROOT."/compta/sociales/charges.php?leftmenu=tax_social&action=create",$langs->trans("MenuNewSocialContribution"), 2, $user->rights->tax->charges->creer);
+ if (preg_match('/^tax/i',$leftmenu)) $newmenu->add(DOL_URL_ROOT."/compta/sociales/index.php?leftmenu=tax_social",$langs->trans("List"), 2, $user->rights->tax->charges->lire);
// VAT
if ($conf->compta->tva)
{
- if (eregi('^tax',$leftmenu)) $newmenu->add(DOL_URL_ROOT."/compta/tva/index.php?leftmenu=tax_vat&mainmenu=accountancy",$langs->trans("VAT"),1,$user->rights->tax->charges->lire);
- if (eregi('^tax',$leftmenu)) $newmenu->add(DOL_URL_ROOT."/compta/tva/fiche.php?leftmenu=tax_vat&action=create",$langs->trans("NewPayment"),2,$user->rights->tax->charges->creer);
- if (eregi('^tax',$leftmenu)) $newmenu->add(DOL_URL_ROOT."/compta/tva/reglement.php?leftmenu=tax_vat",$langs->trans("List"),2,$user->rights->tax->charges->lire);
- if (eregi('^tax',$leftmenu)) $newmenu->add(DOL_URL_ROOT."/compta/tva/clients.php?leftmenu=tax_vat", $langs->trans("ReportByCustomers"), 2, $user->rights->tax->charges->lire);
- if (eregi('^tax',$leftmenu)) $newmenu->add(DOL_URL_ROOT."/compta/tva/quadri_detail.php?leftmenu=tax_vat", $langs->trans("ReportByQuarter"), 2, $user->rights->tax->charges->lire);
+ if (preg_match('/^tax/i',$leftmenu)) $newmenu->add(DOL_URL_ROOT."/compta/tva/index.php?leftmenu=tax_vat&mainmenu=accountancy",$langs->trans("VAT"),1,$user->rights->tax->charges->lire);
+ if (preg_match('/^tax/i',$leftmenu)) $newmenu->add(DOL_URL_ROOT."/compta/tva/fiche.php?leftmenu=tax_vat&action=create",$langs->trans("NewPayment"),2,$user->rights->tax->charges->creer);
+ if (preg_match('/^tax/i',$leftmenu)) $newmenu->add(DOL_URL_ROOT."/compta/tva/reglement.php?leftmenu=tax_vat",$langs->trans("List"),2,$user->rights->tax->charges->lire);
+ if (preg_match('/^tax/i',$leftmenu)) $newmenu->add(DOL_URL_ROOT."/compta/tva/clients.php?leftmenu=tax_vat", $langs->trans("ReportByCustomers"), 2, $user->rights->tax->charges->lire);
+ if (preg_match('/^tax/i',$leftmenu)) $newmenu->add(DOL_URL_ROOT."/compta/tva/quadri_detail.php?leftmenu=tax_vat", $langs->trans("ReportByQuarter"), 2, $user->rights->tax->charges->lire);
}
}
@@ -557,8 +557,8 @@ class MenuLeft {
if ($conf->facture->enabled && $conf->banque->enabled)
{
$newmenu->add(DOL_URL_ROOT."/compta/paiement/cheque/index.php?leftmenu=checks",$langs->trans("MenuChequeDeposits"),0,$user->rights->banque->cheque);
- if (eregi("checks",$leftmenu)) $newmenu->add(DOL_URL_ROOT."/compta/paiement/cheque/fiche.php?leftmenu=checks&action=new",$langs->trans("NewChequeDeposit"),1,$user->rights->banque->cheque);
- if (eregi("checks",$leftmenu)) $newmenu->add(DOL_URL_ROOT."/compta/paiement/cheque/liste.php?leftmenu=checks",$langs->trans("MenuChequesReceipts"),1,$user->rights->banque->cheque);
+ if (preg_match("/checks/i",$leftmenu)) $newmenu->add(DOL_URL_ROOT."/compta/paiement/cheque/fiche.php?leftmenu=checks&action=new",$langs->trans("NewChequeDeposit"),1,$user->rights->banque->cheque);
+ if (preg_match("/checks/i",$leftmenu)) $newmenu->add(DOL_URL_ROOT."/compta/paiement/cheque/liste.php?leftmenu=checks",$langs->trans("MenuChequesReceipts"),1,$user->rights->banque->cheque);
}
*/
@@ -857,8 +857,8 @@ class MenuLeft {
{
$langs->load("bills");
$newmenu->add(DOL_URL_ROOT."/compta/paiement/cheque/index.php?leftmenu=members_checks",$langs->trans("MenuChequeDeposits"),0,$user->rights->adherent->cotisation->lire);
- if (eregi("members_checks",$leftmenu)) $newmenu->add(DOL_URL_ROOT."/compta/paiement/cheque/fiche.php?leftmenu=members_checks&action=new",$langs->trans("NewChequeDeposit"),1,$user->rights->adherent->cotisation->creer);
- if (eregi("members_checks",$leftmenu)) $newmenu->add(DOL_URL_ROOT."/compta/paiement/cheque/liste.php?leftmenu=members_checks",$langs->trans("MenuChequesReceipts"),1,$user->rights->adherent->cotisation->lire);
+ if (preg_match("/members_checks/i",$leftmenu)) $newmenu->add(DOL_URL_ROOT."/compta/paiement/cheque/fiche.php?leftmenu=members_checks&action=new",$langs->trans("NewChequeDeposit"),1,$user->rights->adherent->cotisation->creer);
+ if (preg_match("/members_checks/i",$leftmenu)) $newmenu->add(DOL_URL_ROOT."/compta/paiement/cheque/liste.php?leftmenu=members_checks",$langs->trans("MenuChequesReceipts"),1,$user->rights->adherent->cotisation->lire);
}
if ($conf->banque->enabled)
diff --git a/htdocs/includes/menus/barre_top/auguria_backoffice.php b/htdocs/includes/menus/barre_top/auguria_backoffice.php
index 266e3b09eb9..ba03879b27e 100644
--- a/htdocs/includes/menus/barre_top/auguria_backoffice.php
+++ b/htdocs/includes/menus/barre_top/auguria_backoffice.php
@@ -90,7 +90,7 @@ class MenuTop {
$url=DOL_URL_ROOT.$tabMenu[$i]['url'];
if (! preg_match('/\?/',$url)) $url.='?';
else $url.='&';
- if (! preg_match('/mainmenu/i',$url) || ! eregi('leftmenu',$url))
+ if (! preg_match('/mainmenu/i',$url) || ! preg_match('/leftmenu/i',$url))
{
$url.='mainmenu='.$tabMenu[$i]['mainmenu'].'&leftmenu=&';
}
diff --git a/htdocs/includes/menus/barre_top/auguria_frontoffice.php b/htdocs/includes/menus/barre_top/auguria_frontoffice.php
index 61d86926aab..13bdaae6d7d 100644
--- a/htdocs/includes/menus/barre_top/auguria_frontoffice.php
+++ b/htdocs/includes/menus/barre_top/auguria_frontoffice.php
@@ -81,16 +81,16 @@ class MenuTop {
if ($tabMenu[$i]['right'] == true) // Is allowed
{
// Define url
- if (eregi("^(http:\/\/|https:\/\/)",$tabMenu[$i]['url']))
+ if (preg_match("/^(http:\/\/|https:\/\/)/i",$tabMenu[$i]['url']))
{
$url = $tabMenu[$i]['url'];
}
else
{
$url=DOL_URL_ROOT.$tabMenu[$i]['url'];
- if (! eregi('\?',$url)) $url.='?';
+ if (! preg_match('/\?/',$url)) $url.='?';
else $url.='&';
- if (! eregi('mainmenu',$url) || ! eregi('leftmenu',$url))
+ if (! preg_match('/mainmenu/i',$url) || ! preg_match('/leftmenu/i',$url))
{
$url.='mainmenu='.$tabMenu[$i]['mainmenu'].'&leftmenu=&';
}
diff --git a/htdocs/includes/menus/barre_top/eldy_backoffice.php b/htdocs/includes/menus/barre_top/eldy_backoffice.php
index fc6424a7e93..07dfed3d796 100644
--- a/htdocs/includes/menus/barre_top/eldy_backoffice.php
+++ b/htdocs/includes/menus/barre_top/eldy_backoffice.php
@@ -418,16 +418,16 @@ class MenuTop {
$idsel=(empty($tabMenu[$i]['mainmenu'])?'none':$tabMenu[$i]['mainmenu']);
if ($tabMenu[$i]['right'] == true) // Is allowed
{
- if (eregi("^(http:\/\/|https:\/\/)",$tabMenu[$i]['url']))
+ if (preg_match("/^(http:\/\/|https:\/\/)/i",$tabMenu[$i]['url']))
{
$url = $tabMenu[$i]['url'];
}
else
{
$url=DOL_URL_ROOT.$tabMenu[$i]['url'];
- if (! eregi('\?',$url)) $url.='?';
+ if (! preg_match('/\?/',$url)) $url.='?';
else $url.='&';
- if (! eregi('mainmenu',$url) || ! eregi('leftmenu',$url))
+ if (! preg_match('/mainmenu/i',$url) || ! preg_match('/leftmenu/i',$url))
{
$url.='mainmenu='.$tabMenu[$i]['mainmenu'].'&leftmenu=&';
}
diff --git a/htdocs/includes/menus/barre_top/eldy_frontoffice.php b/htdocs/includes/menus/barre_top/eldy_frontoffice.php
index 9c1a3ed3d33..0d14b9d9a08 100644
--- a/htdocs/includes/menus/barre_top/eldy_frontoffice.php
+++ b/htdocs/includes/menus/barre_top/eldy_frontoffice.php
@@ -417,16 +417,16 @@ class MenuTop {
$idsel=(empty($tabMenu[$i]['mainmenu'])?'none':$tabMenu[$i]['mainmenu']);
if ($tabMenu[$i]['right'] == true) // Is allowed
{
- if (eregi("^(http:\/\/|https:\/\/)",$tabMenu[$i]['url']))
+ if (preg_match("/^(http:\/\/|https:\/\/)/i",$tabMenu[$i]['url']))
{
$url = $tabMenu[$i]['url'];
}
else
{
$url=DOL_URL_ROOT.$tabMenu[$i]['url'];
- if (! eregi('\?',$url)) $url.='?';
+ if (! preg_match('/\?/',$url)) $url.='?';
else $url.='&';
- if (! eregi('mainmenu',$url) || ! eregi('leftmenu',$url))
+ if (! preg_match('/mainmenu/i',$url) || ! preg_match('/leftmenu/i',$url))
{
$url.='mainmenu='.$tabMenu[$i]['mainmenu'].'&leftmenu=&';
}
diff --git a/htdocs/includes/menus/barre_top/empty.php b/htdocs/includes/menus/barre_top/empty.php
index 6462935c5e5..be0bef54554 100644
--- a/htdocs/includes/menus/barre_top/empty.php
+++ b/htdocs/includes/menus/barre_top/empty.php
@@ -86,7 +86,7 @@ class MenuTop {
if ($tabMenu[$i]['right'] == true)
{
$url=DOL_URL_ROOT.$tabMenu[$i]['url'];
- if (! eregi('\?',DOL_URL_ROOT.$tabMenu[$i]['url'])) $url.='?';
+ if (! preg_match('/\?/',DOL_URL_ROOT.$tabMenu[$i]['url'])) $url.='?';
else $url.='&';
$url.='mainmenu='.$tabMenu[$i]['mainmenu'].'&leftmenu=';
$url.="&idmenu=".$tabMenu[$i]['rowid'];
diff --git a/htdocs/includes/menus/barre_top/rodolphe.php b/htdocs/includes/menus/barre_top/rodolphe.php
index f4a7c56d75c..e37d362211d 100644
--- a/htdocs/includes/menus/barre_top/rodolphe.php
+++ b/htdocs/includes/menus/barre_top/rodolphe.php
@@ -360,14 +360,14 @@ class MenuTop {
$idsel=(empty($tabMenu[$i]['mainmenu'])?'id="none" ':'id="'.$tabMenu[$i]['mainmenu'].'" ');
if ($tabMenu[$i]['right'] == true)
{
- if (eregi("^(http:\/\/|https:\/\/)",$tabMenu[$i]['url']))
+ if (preg_match("/^(http:\/\/|https:\/\/)/i",$tabMenu[$i]['url']))
{
$url = $tabMenu[$i]['url'];
}
else
{
$url=DOL_URL_ROOT.$tabMenu[$i]['url'];
- if (! eregi('\?',DOL_URL_ROOT.$tabMenu[$i]['url'])) $url.='?';
+ if (! preg_match('/\?/',DOL_URL_ROOT.$tabMenu[$i]['url'])) $url.='?';
else $url.='&';
$url.='mainmenu='.$tabMenu[$i]['mainmenu'].'&leftmenu=';
$url.="&idmenu=".$tabMenu[$i]['rowid'];
diff --git a/htdocs/includes/modules/DolibarrModules.class.php b/htdocs/includes/modules/DolibarrModules.class.php
index 6aadcaf11ee..daac4463e22 100644
--- a/htdocs/includes/modules/DolibarrModules.class.php
+++ b/htdocs/includes/modules/DolibarrModules.class.php
@@ -451,7 +451,7 @@ class DolibarrModules
{
while (($file = readdir($handle))!==false)
{
- if (eregi('\.sql$',$file) && ! eregi('\.key\.sql$',$file) && substr($file,0,4) == 'llx_' && substr($file,0,4) != 'data')
+ if (preg_match('/\.sql$/i',$file) && ! preg_match('/\.key\.sql$/i',$file) && substr($file,0,4) == 'llx_' && substr($file,0,4) != 'data')
{
$result=run_sql($dir.$file,1);
}
@@ -465,7 +465,7 @@ class DolibarrModules
{
while (($file = readdir($handle))!==false)
{
- if (eregi('\.key\.sql$',$file) && substr($file,0,4) == 'llx_' && substr($file,0,4) != 'data')
+ if (preg_match('/\.key\.sql$/i',$file) && substr($file,0,4) == 'llx_' && substr($file,0,4) != 'data')
{
$result=run_sql($dir.$file,1);
}
@@ -479,7 +479,7 @@ class DolibarrModules
{
while (($file = readdir($handle))!==false)
{
- if (eregi('\.sql$',$file) && ! eregi('\.key\.sql$',$file) && substr($file,0,4) == 'data')
+ if (preg_match('/\.sql$/i',$file) && ! preg_match('/\.key\.sql$/i',$file) && substr($file,0,4) == 'data')
{
$result=run_sql($dir.$file,1);
}
diff --git a/htdocs/includes/modules/commande/mod_commande_marbre.php b/htdocs/includes/modules/commande/mod_commande_marbre.php
index 34ae5b05f80..a099c25e3f0 100644
--- a/htdocs/includes/modules/commande/mod_commande_marbre.php
+++ b/htdocs/includes/modules/commande/mod_commande_marbre.php
@@ -79,7 +79,7 @@ class mod_commande_marbre extends ModeleNumRefCommandes
$row = $db->fetch_row($resql);
if ($row) $coyymm = substr($row[0],0,6);
}
- if ($coyymm && ! eregi($this->prefix.'[0-9][0-9][0-9][0-9]',$coyymm))
+ if ($coyymm && ! preg_match('/'.$this->prefix.'[0-9][0-9][0-9][0-9]/i',$coyymm))
{
$this->error='Une commande commencant par $coyymm existe en base et est incompatible avec cette numerotation. Supprimer la ou renommer la pour activer ce module.';
return false;
diff --git a/htdocs/includes/modules/commande/pdf_einstein.modules.php b/htdocs/includes/modules/commande/pdf_einstein.modules.php
index 795010e011e..ae3e41c8efe 100644
--- a/htdocs/includes/modules/commande/pdf_einstein.modules.php
+++ b/htdocs/includes/modules/commande/pdf_einstein.modules.php
@@ -568,7 +568,7 @@ class pdf_einstein extends ModelePDFCommandes
$pdf->SetXY ($col1x, $tab2_top + $tab2_hl * $index);
$tvacompl='';
- if (eregi('\*',$tvakey))
+ if (preg_match('/\*/',$tvakey))
{
$tvakey=str_replace('*','',$tvakey);
$tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")";
diff --git a/htdocs/includes/modules/export/export_csv.modules.php b/htdocs/includes/modules/export/export_csv.modules.php
index ef2d359bc85..5e6653e3054 100644
--- a/htdocs/includes/modules/export/export_csv.modules.php
+++ b/htdocs/includes/modules/export/export_csv.modules.php
@@ -199,7 +199,7 @@ class ExportCsv extends ModeleExports
$newvalue=$outputlangs->convToOutputCharset($objp->$alias);
// Translation newvalue
- if (eregi('^\((.*)\)$',$newvalue,$reg))
+ if (preg_match('/^\((.*)\)$/i',$newvalue,$reg))
{
$newvalue=$outputlangs->transnoentities($reg[1]);
}
diff --git a/htdocs/includes/modules/export/export_excel.modules.php b/htdocs/includes/modules/export/export_excel.modules.php
index b5835c88032..8fa84c9e627 100644
--- a/htdocs/includes/modules/export/export_excel.modules.php
+++ b/htdocs/includes/modules/export/export_excel.modules.php
@@ -203,7 +203,7 @@ class ExportExcel extends ModeleExports
$newvalue=$this->excel_clean($newvalue);
// Traduction newvalue
- if (eregi('^\((.*)\)$',$newvalue,$reg))
+ if (preg_match('/^\((.*)\)$/i',$newvalue,$reg))
{
$newvalue=$outputlangs->transnoentities($reg[1]);
}
@@ -212,14 +212,14 @@ class ExportExcel extends ModeleExports
$newvalue=$outputlangs->convToOutputCharset($newvalue);
}
- if (eregi('^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]$',$newvalue))
+ if (preg_match('/^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]$/i',$newvalue))
{
$arrayvalue=preg_split('/[.,]/',xl_parse_date($newvalue));
//print "x".$arrayvalue[0].'.'.strval($arrayvalue[1]).' ';
$newvalue=strval($arrayvalue[0]).'.'.strval($arrayvalue[1]); // $newvalue=strval(36892.521); directly does not work because . will be convert into , later
$this->worksheet->write($this->row, $this->col, $newvalue, $formatdate);
}
- elseif (eregi('^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9] [0-9][0-9]:[0-9][0-9]:[0-9][0-9]$',$newvalue))
+ elseif (preg_match('/^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9] [0-9][0-9]:[0-9][0-9]:[0-9][0-9]$/i',$newvalue))
{
$arrayvalue=preg_split('/[.,]/',xl_parse_date($newvalue));
//print "x".$arrayvalue[0].'.'.strval($arrayvalue[1]).' ';
diff --git a/htdocs/includes/modules/export/export_tsv.modules.php b/htdocs/includes/modules/export/export_tsv.modules.php
index a9d7cd48ee4..7cf1a134312 100644
--- a/htdocs/includes/modules/export/export_tsv.modules.php
+++ b/htdocs/includes/modules/export/export_tsv.modules.php
@@ -171,7 +171,7 @@ class ExportTsv extends ModeleExports
$newvalue=$objp->$alias;
// Translation newvalue
- if (eregi('^\((.*)\)$',$newvalue,$reg))
+ if (preg_match('/^\((.*)\)$/i',$newvalue,$reg))
{
$newvalue=$outputlangs->transnoentities($reg[1]);
}
diff --git a/htdocs/includes/modules/export/modules_export.php b/htdocs/includes/modules/export/modules_export.php
index 5af5c80463e..96113f5f4ce 100644
--- a/htdocs/includes/modules/export/modules_export.php
+++ b/htdocs/includes/modules/export/modules_export.php
@@ -66,7 +66,7 @@ class ModeleExports
$i=0;
while (($file = readdir($handle))!==false)
{
- if (eregi("^export_(.*)\.modules\.php$",$file,$reg))
+ if (preg_match("/^export_(.*)\.modules\.php$/i",$file,$reg))
{
$moduleid=$reg[1];
diff --git a/htdocs/includes/modules/facture/pdf_crabe.modules.php b/htdocs/includes/modules/facture/pdf_crabe.modules.php
index 5ba3507ae13..076db0a9e17 100644
--- a/htdocs/includes/modules/facture/pdf_crabe.modules.php
+++ b/htdocs/includes/modules/facture/pdf_crabe.modules.php
@@ -716,7 +716,7 @@ class pdf_crabe extends ModelePDFFactures
$index++;
$pdf->SetXY ($col1x, $tab2_top + $tab2_hl * $index);
$tvacompl='';
- if (eregi('\*',$tvakey))
+ if (preg_match('/\*/',$tvakey))
{
$tvakey=str_replace('*','',$tvakey);
$tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")";
diff --git a/htdocs/includes/modules/facture/pdf_oursin.modules.php b/htdocs/includes/modules/facture/pdf_oursin.modules.php
index c9ea75f5497..81b8ca653b4 100644
--- a/htdocs/includes/modules/facture/pdf_oursin.modules.php
+++ b/htdocs/includes/modules/facture/pdf_oursin.modules.php
@@ -639,7 +639,7 @@ class pdf_oursin extends ModelePDFFactures
$index++;
$pdf->SetXY ($col1x, $tab2_top + $tab2_hl * $index);
$tvacompl='';
- if (eregi('\*',$tvakey))
+ if (preg_match('/\*/',$tvakey))
{
$tvakey=str_replace('*','',$tvakey);
$tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")";
diff --git a/htdocs/includes/modules/facture/terre/terre.modules.php b/htdocs/includes/modules/facture/terre/terre.modules.php
index 0e6e0aacdaf..b36d9b3c4f4 100644
--- a/htdocs/includes/modules/facture/terre/terre.modules.php
+++ b/htdocs/includes/modules/facture/terre/terre.modules.php
@@ -82,7 +82,7 @@ class mod_facture_terre extends ModeleNumRefFactures
$row = $db->fetch_row($resql);
if ($row) $fayymm = substr($row[0],0,6);
}
- if ($fayymm && ! eregi($this->prefixinvoice.'[0-9][0-9][0-9][0-9]',$fayymm))
+ if ($fayymm && ! preg_match('/'.$this->prefixinvoice.'[0-9][0-9][0-9][0-9]/i',$fayymm))
{
$this->error=$langs->trans('TerreNumRefModelError');
return false;
@@ -102,7 +102,7 @@ class mod_facture_terre extends ModeleNumRefFactures
$row = $db->fetch_row($resql);
if ($row) $fayymm = substr($row[0],0,6);
}
- if ($fayymm && ! eregi($this->prefixcreditnote.'[0-9][0-9][0-9][0-9]',$fayymm))
+ if ($fayymm && ! preg_match('/'.$this->prefixcreditnote.'[0-9][0-9][0-9][0-9]/i',$fayymm))
{
$this->error=$langs->trans('TerreNumRefModelError');
return false;
diff --git a/htdocs/includes/modules/fichinter/mod_pacific.php b/htdocs/includes/modules/fichinter/mod_pacific.php
index 7cea35f9d65..bdcd4ac9e35 100644
--- a/htdocs/includes/modules/fichinter/mod_pacific.php
+++ b/htdocs/includes/modules/fichinter/mod_pacific.php
@@ -21,7 +21,7 @@
/**
\file htdocs/includes/modules/fichinter/mod_pacific.php
\ingroup fiche intervention
- \brief Fichier contenant la classe du modèle de numérotation de référence de fiche intervention Pacific
+ \brief Fichier contenant la classe du modele de numerotation de reference de fiche intervention Pacific
\version $Id$
*/
@@ -29,7 +29,7 @@ require_once(DOL_DOCUMENT_ROOT ."/includes/modules/fichinter/modules_fichinter.p
/**
\class mod_pacific
- \brief Classe du modèle de numérotation de référence de fiche intervention Pacific
+ \brief Classe du moderotation de reference de fiche intervention Pacific
*/
class mod_pacific extends ModeleNumRefFicheinter
@@ -46,7 +46,7 @@ class mod_pacific extends ModeleNumRefFicheinter
}
- /** \brief Renvoi la description du modele de numérotation
+ /** \brief Renvoi la description du modele de numerotation
* \return string Texte descripif
*/
function info()
@@ -58,7 +58,7 @@ class mod_pacific extends ModeleNumRefFicheinter
return $langs->trans('PacificNumRefModelDesc1',$this->prefix);
}
- /** \brief Renvoi un exemple de numérotation
+ /** \brief Renvoi un exemple de numerotation
* \return string Example
*/
function getExample()
@@ -66,8 +66,8 @@ class mod_pacific extends ModeleNumRefFicheinter
return $this->prefix."0501-0001";
}
- /** \brief Test si les numéros déjà en vigueur dans la base ne provoquent pas de
- * de conflits qui empechera cette numérotation de fonctionner.
+ /** \brief Test si les numeros deja en vigueur dans la base ne provoquent pas de
+ * de conflits qui empechera cette numerotation de fonctionner.
* \return boolean false si conflit, true si ok
*/
function canBeActivated()
@@ -88,7 +88,7 @@ class mod_pacific extends ModeleNumRefFicheinter
$row = $db->fetch_row($resql);
if ($row) $fayymm = substr($row[0],0,6);
}
- if (! $fayymm || eregi($this->prefix.'[0-9][0-9][0-9][0-9]',$fayymm))
+ if (! $fayymm || preg_match('/'.$this->prefix.'[0-9][0-9][0-9][0-9]/i',$fayymm))
{
return true;
}
@@ -99,8 +99,8 @@ class mod_pacific extends ModeleNumRefFicheinter
}
}
- /** \brief Renvoi prochaine valeur attribuée
- * \param objsoc Objet société
+ /** \brief Renvoi prochaine valeur attribuee
+ * \param objsoc Objet societe
* \param ficheinter Object ficheinter
* \return string Valeur
*/
@@ -108,7 +108,7 @@ class mod_pacific extends ModeleNumRefFicheinter
{
global $db,$conf;
- // D'abord on récupère la valeur max (réponse immédiate car champ indéxé)
+ // D'abord on recupere la valeur max (reponse immediate car champ indexe)
$posindice=8;
$sql = "SELECT MAX(0+SUBSTRING(ref,".$posindice.")) as max";
diff --git a/htdocs/includes/modules/fichinter/pdf_soleil.modules.php b/htdocs/includes/modules/fichinter/pdf_soleil.modules.php
index 71754459662..6e81bfaca91 100644
--- a/htdocs/includes/modules/fichinter/pdf_soleil.modules.php
+++ b/htdocs/includes/modules/fichinter/pdf_soleil.modules.php
@@ -108,7 +108,7 @@ class pdf_soleil extends ModelePDFFicheinter
$fichref = dol_sanitizeFileName($fichinter->ref);
$dir = $conf->ficheinter->dir_output;
- if (! eregi('specimen',$fichref)) $dir.= "/" . $fichref;
+ if (! preg_match('/specimen/i',$fichref)) $dir.= "/" . $fichref;
$file = $dir . "/" . $fichref . ".pdf";
if (! file_exists($dir))
diff --git a/htdocs/includes/modules/import/import_csv.modules.php b/htdocs/includes/modules/import/import_csv.modules.php
index 4143435aeb3..5e1a894b899 100644
--- a/htdocs/includes/modules/import/import_csv.modules.php
+++ b/htdocs/includes/modules/import/import_csv.modules.php
@@ -331,7 +331,7 @@ class ImportCsv extends ModeleImports
// Make some tests
// Required field is ok
- if (eregi('\*',$objimport->array_import_fields[0][$val]) && ($newval==''))
+ if (preg_match('/\*/',$objimport->array_import_fields[0][$val]) && ($newval==''))
{
$this->errors[$error]['lib']=$langs->trans('ErrorMissingMandatoryValue',$key);
$this->errors[$error]['type']='NOTNULL';
@@ -340,7 +340,7 @@ class ImportCsv extends ModeleImports
}
// Test format only if field is not a missing mandatory field
else {
- if (! empty($objimport->array_import_regex[0][$val]) && ! eregi($objimport->array_import_regex[0][$val],$newval))
+ if (! empty($objimport->array_import_regex[0][$val]) && ! preg_match('/'.$objimport->array_import_regex[0][$val].'/i',$newval))
{
$this->errors[$error]['lib']=$langs->trans('ErrorWrongValueForField',$key,$newval,$objimport->array_import_regex[0][$val]);
$this->errors[$error]['type']='REGEX';
diff --git a/htdocs/includes/modules/import/modules_import.php b/htdocs/includes/modules/import/modules_import.php
index 9442cde9797..43f588332f1 100644
--- a/htdocs/includes/modules/import/modules_import.php
+++ b/htdocs/includes/modules/import/modules_import.php
@@ -66,7 +66,7 @@ class ModeleImports
$i=0;
while (($file = readdir($handle))!==false)
{
- if (eregi("^import_(.*)\.modules\.php",$file,$reg))
+ if (preg_match("/^import_(.*)\.modules\.php/i",$file,$reg))
{
$moduleid=$reg[1];
diff --git a/htdocs/includes/modules/livraison/mod_livraison_jade.php b/htdocs/includes/modules/livraison/mod_livraison_jade.php
index 02c3b93dd3b..22ebd0db858 100644
--- a/htdocs/includes/modules/livraison/mod_livraison_jade.php
+++ b/htdocs/includes/modules/livraison/mod_livraison_jade.php
@@ -82,7 +82,7 @@ class mod_livraison_jade extends ModeleNumRefDeliveryOrder
}
// Si au moins un champ respectant le modele a ete trouvee
- if (eregi('BL[0-9][0-9]',$blyy))
+ if (preg_match('/BL[0-9][0-9]/i',$blyy))
{
// Recherche rapide car restreint par un like sur champ indexe
$posindice=5;
diff --git a/htdocs/includes/modules/livraison/pdf/pdf_sirocco.modules.php b/htdocs/includes/modules/livraison/pdf/pdf_sirocco.modules.php
index 6931f3c3147..b5bc1076bcd 100644
--- a/htdocs/includes/modules/livraison/pdf/pdf_sirocco.modules.php
+++ b/htdocs/includes/modules/livraison/pdf/pdf_sirocco.modules.php
@@ -123,7 +123,7 @@ class pdf_sirocco extends ModelePDFDeliveryOrder
$objectref = dol_sanitizeFileName($object->ref);
$dir = $conf->expedition->dir_output."/receipt";
- if (! eregi('specimen',$objectref)) $dir.= "/" . $objectref;
+ if (! preg_match('/specimen/i',$objectref)) $dir.= "/" . $objectref;
$file = $dir . "/" . $objectref . ".pdf";
if (! file_exists($dir))
diff --git a/htdocs/includes/modules/livraison/pdf/pdf_typhon.modules.php b/htdocs/includes/modules/livraison/pdf/pdf_typhon.modules.php
index ef17545a7de..456fb32585b 100644
--- a/htdocs/includes/modules/livraison/pdf/pdf_typhon.modules.php
+++ b/htdocs/includes/modules/livraison/pdf/pdf_typhon.modules.php
@@ -144,7 +144,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder
$objectref = dol_sanitizeFileName($object->ref);
$dir = $conf->expedition->dir_output."/receipt";
- if (! eregi('specimen',$objectref)) $dir.= "/" . $objectref;
+ if (! preg_match('/specimen/i',$objectref)) $dir.= "/" . $objectref;
$file = $dir . "/" . $objectref . ".pdf";
if (! file_exists($dir))
diff --git a/htdocs/includes/modules/modExternalRss.class.php b/htdocs/includes/modules/modExternalRss.class.php
index 28369e7efdc..1e75d5a850f 100644
--- a/htdocs/includes/modules/modExternalRss.class.php
+++ b/htdocs/includes/modules/modExternalRss.class.php
@@ -103,7 +103,7 @@ class modExternalRss extends DolibarrModules
{
while ($obj = $this->db->fetch_object($result))
{
- if (eregi('EXTERNAL_RSS_TITLE_([0-9]+)',$obj->name,$reg))
+ if (preg_match('/EXTERNAL_RSS_TITLE_([0-9]+)/i',$obj->name,$reg))
{
// Definie la boite si on a trouvee une ancienne configuration
$this->boxes[$reg[1]][0] = "(ExternalRSSInformations)";
diff --git a/htdocs/includes/modules/propale/mod_propale_marbre.php b/htdocs/includes/modules/propale/mod_propale_marbre.php
index 1863b62a114..c8b68a8be12 100644
--- a/htdocs/includes/modules/propale/mod_propale_marbre.php
+++ b/htdocs/includes/modules/propale/mod_propale_marbre.php
@@ -79,7 +79,7 @@ class mod_propale_marbre extends ModeleNumRefPropales
$row = $db->fetch_row($resql);
if ($row) $pryymm = substr($row[0],0,6);
}
- if (! $pryymm || eregi('PR[0-9][0-9][0-9][0-9]',$pryymm))
+ if (! $pryymm || preg_match('/PR[0-9][0-9][0-9][0-9]/i',$pryymm))
{
return true;
}
diff --git a/htdocs/includes/modules/propale/pdf_propale_azur.modules.php b/htdocs/includes/modules/propale/pdf_propale_azur.modules.php
index 63d994c2233..0f6831b2c3d 100644
--- a/htdocs/includes/modules/propale/pdf_propale_azur.modules.php
+++ b/htdocs/includes/modules/propale/pdf_propale_azur.modules.php
@@ -597,7 +597,7 @@ class pdf_propale_azur extends ModelePDFPropales
$pdf->SetXY ($col1x, $tab2_top + $tab2_hl * $index);
$tvacompl='';
- if (eregi('\*',$tvakey))
+ if (preg_match('/\*/',$tvakey))
{
$tvakey=str_replace('*','',$tvakey);
$tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")";
diff --git a/htdocs/includes/modules/societe/mod_codeclient_elephant.php b/htdocs/includes/modules/societe/mod_codeclient_elephant.php
index d913267f529..e992e38896d 100644
--- a/htdocs/includes/modules/societe/mod_codeclient_elephant.php
+++ b/htdocs/includes/modules/societe/mod_codeclient_elephant.php
@@ -187,10 +187,10 @@ class mod_codeclient_elephant extends ModeleThirdPartyCode
global $conf;
$mask = $conf->global->COMPANY_ELEPHANT_MASK_CUSTOMER;
- if (eregi('\{pre\}',$mask)) return 1;
+ if (preg_match('/\{pre\}/i',$mask)) return 1;
$mask = $conf->global->COMPANY_ELEPHANT_MASK_SUPPLIER;
- if (eregi('\{pre\}',$mask)) return 1;
+ if (preg_match('/\{pre\}/i',$mask)) return 1;
return 0;
}
diff --git a/htdocs/includes/modules/supplier_order/mod_commande_fournisseur_muguet.php b/htdocs/includes/modules/supplier_order/mod_commande_fournisseur_muguet.php
index e083768c515..8d943a42d4a 100644
--- a/htdocs/includes/modules/supplier_order/mod_commande_fournisseur_muguet.php
+++ b/htdocs/includes/modules/supplier_order/mod_commande_fournisseur_muguet.php
@@ -76,7 +76,7 @@ class mod_commande_fournisseur_muguet extends ModeleNumRefSuppliersOrders
$row = $db->fetch_row($resql);
if ($row) $coyymm = substr($row[0],0,6);
}
- if (! $coyymm || eregi($this->prefix.'[0-9][0-9][0-9][0-9]',$coyymm))
+ if (! $coyymm || preg_match('/'.$this->prefix.'[0-9][0-9][0-9][0-9]/i',$coyymm))
{
return true;
}
diff --git a/htdocs/includes/modules/supplier_order/pdf/pdf_muscadet.modules.php b/htdocs/includes/modules/supplier_order/pdf/pdf_muscadet.modules.php
index 451d3a0475a..aa1b10a225e 100644
--- a/htdocs/includes/modules/supplier_order/pdf/pdf_muscadet.modules.php
+++ b/htdocs/includes/modules/supplier_order/pdf/pdf_muscadet.modules.php
@@ -451,7 +451,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
$tvacompl='';
- if (eregi('\*',$tvakey))
+ if (preg_match('/\*/',$tvakey))
{
$tvakey=str_replace('*','',$tvakey);
$tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")";
diff --git a/htdocs/includes/nusoap/lib/class.soap_server.php b/htdocs/includes/nusoap/lib/class.soap_server.php
index e9d1644ef97..88eca9f32b6 100644
--- a/htdocs/includes/nusoap/lib/class.soap_server.php
+++ b/htdocs/includes/nusoap/lib/class.soap_server.php
@@ -316,7 +316,7 @@ class nusoap_server extends nusoap_base {
// get the character encoding of the incoming request
if(isset($this->headers['content-type']) && strpos($this->headers['content-type'],'=')){
$enc = str_replace('"','',substr(strstr($this->headers["content-type"],'='),1));
- if(eregi('^(ISO-8859-1|US-ASCII|UTF-8)$',$enc)){
+ if(preg_match('/^(ISO-8859-1|US-ASCII|UTF-8)$/i',$enc)){
$this->xml_encoding = strtoupper($enc);
} else {
$this->xml_encoding = 'US-ASCII';
@@ -345,7 +345,7 @@ class nusoap_server extends nusoap_base {
$enc = substr(strstr($v, '='), 1);
$enc = str_replace('"', '', $enc);
$enc = str_replace('\\', '', $enc);
- if (eregi('^(ISO-8859-1|US-ASCII|UTF-8)$', $enc)) {
+ if (preg_match('/^(ISO-8859-1|US-ASCII|UTF-8)$/i', $enc)) {
$this->xml_encoding = strtoupper($enc);
} else {
$this->xml_encoding = 'US-ASCII';
@@ -379,7 +379,7 @@ class nusoap_server extends nusoap_base {
$enc = substr(strstr($v, '='), 1);
$enc = str_replace('"', '', $enc);
$enc = str_replace('\\', '', $enc);
- if (eregi('^(ISO-8859-1|US-ASCII|UTF-8)$', $enc)) {
+ if (preg_match('/^(ISO-8859-1|US-ASCII|UTF-8)$/i', $enc)) {
$this->xml_encoding = strtoupper($enc);
} else {
$this->xml_encoding = 'US-ASCII';
@@ -805,7 +805,7 @@ class nusoap_server extends nusoap_base {
if (strpos($headers['content-type'], '=')) {
$enc = str_replace('"', '', substr(strstr($headers["content-type"], '='), 1));
$this->debug('Got response encoding: ' . $enc);
- if(eregi('^(ISO-8859-1|US-ASCII|UTF-8)$',$enc)){
+ if(preg_match('/^(ISO-8859-1|US-ASCII|UTF-8)$/i',$enc)){
$this->xml_encoding = strtoupper($enc);
} else {
$this->xml_encoding = 'US-ASCII';
diff --git a/htdocs/includes/nusoap/lib/class.soapclient.php b/htdocs/includes/nusoap/lib/class.soapclient.php
index f828aa78121..3fe15fad6e2 100644
--- a/htdocs/includes/nusoap/lib/class.soapclient.php
+++ b/htdocs/includes/nusoap/lib/class.soapclient.php
@@ -490,7 +490,7 @@ class nusoap_client extends nusoap_base {
if (strpos($headers['content-type'], '=')) {
$enc = str_replace('"', '', substr(strstr($headers["content-type"], '='), 1));
$this->debug('Got response encoding: ' . $enc);
- if(eregi('^(ISO-8859-1|US-ASCII|UTF-8)$',$enc)){
+ if(preg_match('/^(ISO-8859-1|US-ASCII|UTF-8)$/i',$enc)){
$this->xml_encoding = strtoupper($enc);
} else {
$this->xml_encoding = 'US-ASCII';
diff --git a/htdocs/includes/nusoap/lib/nusoap.php b/htdocs/includes/nusoap/lib/nusoap.php
index 34af56b7ddb..6cb65e8f6dd 100644
--- a/htdocs/includes/nusoap/lib/nusoap.php
+++ b/htdocs/includes/nusoap/lib/nusoap.php
@@ -3725,7 +3725,7 @@ class nusoap_server extends nusoap_base {
// get the character encoding of the incoming request
if(isset($this->headers['content-type']) && strpos($this->headers['content-type'],'=')){
$enc = str_replace('"','',substr(strstr($this->headers["content-type"],'='),1));
- if(eregi('^(ISO-8859-1|US-ASCII|UTF-8)$',$enc)){
+ if(preg_match('/^(ISO-8859-1|US-ASCII|UTF-8)$/i',$enc)){
$this->xml_encoding = strtoupper($enc);
} else {
$this->xml_encoding = 'US-ASCII';
@@ -3754,7 +3754,7 @@ class nusoap_server extends nusoap_base {
$enc = substr(strstr($v, '='), 1);
$enc = str_replace('"', '', $enc);
$enc = str_replace('\\', '', $enc);
- if (eregi('^(ISO-8859-1|US-ASCII|UTF-8)$', $enc)) {
+ if (preg_match('/^(ISO-8859-1|US-ASCII|UTF-8)$/i', $enc)) {
$this->xml_encoding = strtoupper($enc);
} else {
$this->xml_encoding = 'US-ASCII';
@@ -3788,7 +3788,7 @@ class nusoap_server extends nusoap_base {
$enc = substr(strstr($v, '='), 1);
$enc = str_replace('"', '', $enc);
$enc = str_replace('\\', '', $enc);
- if (eregi('^(ISO-8859-1|US-ASCII|UTF-8)$', $enc)) {
+ if (preg_match('/^(ISO-8859-1|US-ASCII|UTF-8)$/i', $enc)) {
$this->xml_encoding = strtoupper($enc);
} else {
$this->xml_encoding = 'US-ASCII';
@@ -4214,7 +4214,7 @@ class nusoap_server extends nusoap_base {
if (strpos($headers['content-type'], '=')) {
$enc = str_replace('"', '', substr(strstr($headers["content-type"], '='), 1));
$this->debug('Got response encoding: ' . $enc);
- if(eregi('^(ISO-8859-1|US-ASCII|UTF-8)$',$enc)){
+ if(preg_match('/^(ISO-8859-1|US-ASCII|UTF-8)$/i',$enc)){
$this->xml_encoding = strtoupper($enc);
} else {
$this->xml_encoding = 'US-ASCII';
@@ -7506,7 +7506,7 @@ class nusoap_client extends nusoap_base {
if (strpos($headers['content-type'], '=')) {
$enc = str_replace('"', '', substr(strstr($headers["content-type"], '='), 1));
$this->debug('Got response encoding: ' . $enc);
- if(eregi('^(ISO-8859-1|US-ASCII|UTF-8)$',$enc)){
+ if(preg_match('/^(ISO-8859-1|US-ASCII|UTF-8)$/i',$enc)){
$this->xml_encoding = strtoupper($enc);
} else {
$this->xml_encoding = 'US-ASCII';
diff --git a/htdocs/includes/php_writeexcel/class.writeexcel_formula.inc.php b/htdocs/includes/php_writeexcel/class.writeexcel_formula.inc.php
index 682a122f5ec..7ae1881e497 100644
--- a/htdocs/includes/php_writeexcel/class.writeexcel_formula.inc.php
+++ b/htdocs/includes/php_writeexcel/class.writeexcel_formula.inc.php
@@ -1436,7 +1436,7 @@ function _fact()
$this->_advance();
return $result;
}
- elseif (eregi("^[A-Z0-9\xc0-\xdc\.]+$",$this->_current_token))
+ elseif (preg_match("/^[A-Z0-9\xc0-\xdc\.]+$/i",$this->_current_token))
{
// if it's a function call
$result = $this->_func();