Fix: functions "ereg", "ereg_replace", "eregi", "eregi_replace" is deprecated since php 5.3.0

This commit is contained in:
Regis Houssin 2009-10-22 15:09:04 +00:00
parent 8c9dd5dff0
commit 37c2825f93
68 changed files with 183 additions and 183 deletions

View File

@ -167,7 +167,7 @@ if ($action == 'create')
} }
if ($_GET["id"] > 0 && ! eregi('^add',$_GET["action"])) if ($_GET["id"] > 0 && ! preg_match('/^add/i',$_GET["action"]))
{ {
/* /*
* Fiche bookmark en mode visu ou edition * Fiche bookmark en mode visu ou edition
@ -198,7 +198,7 @@ if ($_GET["id"] > 0 && ! eregi('^add',$_GET["action"]))
print '<tr><td>'.$langs->trans("UrlOrLink").'</td><td>'; print '<tr><td>'.$langs->trans("UrlOrLink").'</td><td>';
if ($_GET["action"] == 'edit') print '<input class="flat" name="url" size="80" value="'.(isset($_POST["url"])?$_POST["url"]:$bookmark->url).'">'; if ($_GET["action"] == 'edit') print '<input class="flat" name="url" size="80" value="'.(isset($_POST["url"])?$_POST["url"]:$bookmark->url).'">';
else print '<a href="'.(eregi('^http',$bookmark->url)?$bookmark->url:DOL_URL_ROOT.$bookmark->url).'"'.($bookmark->target?' target="_blank"':'').'>'.$bookmark->url.'</a>'; else print '<a href="'.(preg_match('/^http/i',$bookmark->url)?$bookmark->url:DOL_URL_ROOT.$bookmark->url).'"'.($bookmark->target?' target="_blank"':'').'>'.$bookmark->url.'</a>';
print '</td></tr>'; print '</td></tr>';
print '<tr><td>'.$langs->trans("BehaviourOnClick").'</td><td>'; print '<tr><td>'.$langs->trans("BehaviourOnClick").'</td><td>';

View File

@ -57,7 +57,7 @@ $conf_taille_listes = 200; // Nombre max de lignes a afficher dans les listes
$conf_nbr_car_listes = 60; // Nombre max de caracteres par ligne dans les listes $conf_nbr_car_listes = 60; // Nombre max de caracteres par ligne dans les listes
//$new_conf_db_type=$conf_db_type; //$new_conf_db_type=$conf_db_type;
//if (eregi('mysql',$new_conf_db_type)) $new_conf_db_type='Mysql'; //if (preg_match('/mysql/i',$new_conf_db_type)) $new_conf_db_type='Mysql';
//require ('classes/'.$new_conf_db_type.'.class.php'); //require ('classes/'.$new_conf_db_type.'.class.php');
//$sql = new Sql ($conf_db_host, $conf_db_user, $conf_db_pass, $conf_db_base); //$sql = new Sql ($conf_db_host, $conf_db_user, $conf_db_pass, $conf_db_base);

View File

@ -210,7 +210,7 @@ foreach($fulltree as $key => $val)
// If directory is brother of selected directory, we show line // If directory is brother of selected directory, we show line
elseif ($val['id'] != $section && $val['id_mere'] == $ecmdirstatic->motherof[$section]) $showline=3; 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 // 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 // If we are level one we show line
elseif ($val['level'] < 2) $showline=1; elseif ($val['level'] < 2) $showline=1;

View File

@ -279,7 +279,7 @@ if ($_GET["id"] || $_GET["ref"])
print '<br>'; print '<br>';
// On propose la generation de la vignette si elle n'existe pas et si la taille est superieure aux limites // On propose la generation de la vignette si elle n'existe pas et si la taille est superieure aux limites
if (!$obj['photo_vignette'] && eregi('(\.bmp|\.gif|\.jpg|\.jpeg|\.png)$',$obj['photo']) && ($c->imgWidth > $maxWidth || $c->imgHeight > $maxHeight)) if (!$obj['photo_vignette'] && preg_match('/(\.bmp|\.gif|\.jpg|\.jpeg|\.png)$/i',$obj['photo']) && ($c->imgWidth > $maxWidth || $c->imgHeight > $maxHeight))
{ {
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$_GET["id"].'&amp;action=addthumb&amp;type='.$type.'&amp;file='.urlencode($pdir.$viewfilename).'">'.img_refresh($langs->trans('GenerateThumb')).'&nbsp;&nbsp;</a>'; print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$_GET["id"].'&amp;action=addthumb&amp;type='.$type.'&amp;file='.urlencode($pdir.$viewfilename).'">'.img_refresh($langs->trans('GenerateThumb')).'&nbsp;&nbsp;</a>';
} }

View File

@ -532,7 +532,7 @@ if ($_GET["action"] == 'create')
print '<br>'; print '<br>';
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';
if (! empty($_GET["datep"]) && eregi('^([0-9][0-9][0-9][0-9])([0-9][0-9])([0-9][0-9])$',$_GET["datep"],$reg)) if (! empty($_GET["datep"]) && preg_match('/^([0-9][0-9][0-9][0-9])([0-9][0-9])([0-9][0-9])$/',$_GET["datep"],$reg))
{ {
$actioncomm->datep=dol_mktime(0,0,0,$reg[2],$reg[3],$reg[1]); $actioncomm->datep=dol_mktime(0,0,0,$reg[2],$reg[3],$reg[1]);
} }

View File

@ -427,7 +427,7 @@ if (! is_array($theme_datacolor)) $theme_datacolor=array(array(120,130,150), arr
// Add link to show birthdays // Add link to show birthdays
$link='<a href="'.$_SERVER['PHP_SELF']; $link='<a href="'.$_SERVER['PHP_SELF'];
$newparam=preg_replace('/showbirthday=[0-1]/i','showbirthday='.(empty($showbirthday)?1:0),$param); $newparam=preg_replace('/showbirthday=[0-1]/i','showbirthday='.(empty($showbirthday)?1:0),$param);
if (! eregi('showbirthday=',$newparam)) $newparam.='&showbirthday=1'; if (! preg_match('/showbirthday=/i',$newparam)) $newparam.='&showbirthday=1';
if ($_REQUEST['action']) $newparam.='&action='.$_REQUEST['action']; if ($_REQUEST['action']) $newparam.='&action='.$_REQUEST['action'];
$link.='?'.$newparam; $link.='?'.$newparam;
$link.='">'; $link.='">';

View File

@ -239,7 +239,7 @@ if ($mil->fetch($_REQUEST["id"]) >= 0)
{ {
if (substr($file, 0, 1) <> '.' && substr($file, 0, 3) <> 'CVS') if (substr($file, 0, 1) <> '.' && substr($file, 0, 3) <> 'CVS')
{ {
if (eregi("(.*)\.modules\.php$",$file,$reg)) if (preg_match("/(.*)\.modules\.php$/i",$file,$reg))
{ {
$modulename=$reg[1]; $modulename=$reg[1];
if ($modulename == 'example') continue; if ($modulename == 'example') continue;

View File

@ -120,7 +120,7 @@ if ($_POST["action"] == 'sendallconfirmed' && $_POST['confirm'] == 'yes')
$errorsto = $mil->email_errorsto; $errorsto = $mil->email_errorsto;
// Le message est-il en html // Le message est-il en html
$msgishtml=-1; // Unknown by default $msgishtml=-1; // Unknown by default
if (eregi('[ \t]*<html>',$message)) $msgishtml=1; if (preg_match('/[\s\t]*<html>/i',$message)) $msgishtml=1;
// Warning, we must not use begin-commit transaction here // Warning, we must not use begin-commit transaction here
// because we want to save update for each mail sent. // because we want to save update for each mail sent.
@ -297,7 +297,7 @@ if ($_POST["action"] == 'send' && empty($_POST["cancel"]))
// Le message est-il en html // Le message est-il en html
$msgishtml=-1; // Inconnu par defaut $msgishtml=-1; // Inconnu par defaut
if (eregi('[ \t]*<html>',$message)) $msgishtml=1; if (preg_match('/[\s\t]*<html>/i',$message)) $msgishtml=1;
// Pratique les substitutions sur le sujet et message // Pratique les substitutions sur le sujet et message
$mil->sujet=make_substitutions($mil->sujet,$substitutionarrayfortest); $mil->sujet=make_substitutions($mil->sujet,$substitutionarrayfortest);

View File

@ -75,7 +75,7 @@ while (($file = readdir($handle))!==false)
{ {
if (substr($file, 0, 1) <> '.' && substr($file, 0, 3) <> 'CVS') if (substr($file, 0, 1) <> '.' && substr($file, 0, 3) <> 'CVS')
{ {
if (eregi("(.*)\.(.*)\.(.*)",$file,$reg)) if (preg_match("/(.*)\.(.*)\.(.*)/i",$file,$reg))
{ {
$modulename=$reg[1]; $modulename=$reg[1];
if ($modulename == 'example') continue; if ($modulename == 'example') continue;

View File

@ -240,7 +240,7 @@ class Commande extends CommonObject
$result=$soc->set_as_client(); $result=$soc->set_as_client();
// Define new ref // Define new ref
if (! $error && (eregi('^\(PROV', $this->ref) || eregi('^PROV', $this->ref))) if (! $error && (preg_match('/^\(PROV/i', $this->ref) || preg_match('/^PROV/i', $this->ref)))
{ {
$num = $this->getNextNumRef($soc); $num = $this->getNextNumRef($soc);
} }
@ -291,7 +291,7 @@ class Commande extends CommonObject
if (! $error) if (! $error)
{ {
// Rename directory if dir was a temporary ref // Rename directory if dir was a temporary ref
if (eregi('^\(PROV', $this->ref) || eregi('^PROV', $this->ref)) if (preg_match('/^\(PROV/i', $this->ref) || preg_match('/^PROV/i', $this->ref))
{ {
// On renomme repertoire ($this->ref = ancienne ref, $numfa = nouvelle ref) // On renomme repertoire ($this->ref = ancienne ref, $numfa = nouvelle ref)
// afin de ne pas perdre les fichiers attaches // afin de ne pas perdre les fichiers attaches

View File

@ -831,7 +831,7 @@ class Account extends CommonObject
if (! empty($this->iban)) if (! empty($this->iban))
{ {
// If IBAN defined, we can know country of account from it // If IBAN defined, we can know country of account from it
if (eregi("^([a-zA-Z][a-zA-Z])",$this->iban,$reg)) return $reg[1]; if (preg_match("/^([a-zA-Z][a-zA-Z])/i",$this->iban,$reg)) return $reg[1];
} }
// We return country code // We return country code

View File

@ -510,7 +510,7 @@ if ($account || $_GET["ref"])
//if ($isbanktransfert || $issocialcontrib) $showlabel=true; //if ($isbanktransfert || $issocialcontrib) $showlabel=true;
if ($showlabel) if ($showlabel)
{ {
if (eregi('^\((.*)\)$',$objp->label,$reg)) if (preg_match('/^\((.*)\)$/i',$objp->label,$reg))
{ {
// Genereic description because between (). We show it after translating. // Genereic description because between (). We show it after translating.
print $langs->trans($reg[1]); print $langs->trans($reg[1]);
@ -565,9 +565,9 @@ if ($account || $_GET["ref"])
else { else {
//print ' - '; //print ' - ';
print '<a href="'.$links[$key]['url'].$links[$key]['url_id'].'">'; print '<a href="'.$links[$key]['url'].$links[$key]['url_id'].'">';
if (eregi('^\((.*)\)$',$links[$key]['label'],$reg)) if (preg_match('/^\((.*)\)$/i',$links[$key]['label'],$reg))
{ {
// Label g<EFBFBD>n<EFBFBD>rique car entre parenth<74>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'; if ($reg[1]=='paiement') $reg[1]='Payment';
print $langs->trans($reg[1]); print $langs->trans($reg[1]);
} }
@ -592,7 +592,7 @@ if ($account || $_GET["ref"])
} }
/*else if ($links[$key]['type']=='sc') { /*else if ($links[$key]['type']=='sc') {
$chargestatic->id=$links[$key]['url_id']; $chargestatic->id=$links[$key]['url_id'];
if (eregi('^\((.*)\)$',$links[$key]['label'],$reg)) if (preg_match('/^\((.*)\)$/i',$links[$key]['label'],$reg))
{ {
if ($reg[1]=='socialcontribution') $reg[1]='SocialContribution'; if ($reg[1]=='socialcontribution') $reg[1]='SocialContribution';
$chargestatic->lib=$langs->trans($reg[1]); $chargestatic->lib=$langs->trans($reg[1]);

View File

@ -57,7 +57,7 @@ $form = new Form($db);
// Get account informations // Get account informations
$acct = new Account($db); $acct = new Account($db);
if ($_GET["account"] && ! eregi(',',$_GET["account"])) // if for a particular account and not a list if ($_GET["account"] && ! preg_match('/,/',$_GET["account"])) // if for a particular account and not a list
{ {
$result=$acct->fetch($_GET["account"]); $result=$acct->fetch($_GET["account"]);
} }
@ -140,7 +140,7 @@ print '<tr><td valign="top" width="25%">'.$langs->trans("Ref").'</td>';
print '<td colspan="3">'; print '<td colspan="3">';
if ($_GET["account"]) if ($_GET["account"])
{ {
if (! eregi(',',$_GET["account"])) if (! preg_match('/,/',$_GET["account"]))
{ {
print $form->showrefnav($acct,'ref','',1,'ref'); print $form->showrefnav($acct,'ref','',1,'ref');
} }

View File

@ -69,7 +69,7 @@ if (! empty($_GET["month"])) $month=sprintf("%02d",$_GET["month"]);
$acct = new Account($db); $acct = new Account($db);
if ($_GET["account"] && ! eregi(',',$_GET["account"])) // if for a particular account and not a list if ($_GET["account"] && ! preg_match('/,/',$_GET["account"])) // if for a particular account and not a list
{ {
$result=$acct->fetch($_GET["account"]); $result=$acct->fetch($_GET["account"]);
} }
@ -739,7 +739,7 @@ print '<tr><td valign="top" width="25%">'.$langs->trans("Ref").'</td>';
print '<td colspan="3">'; print '<td colspan="3">';
if ($account) if ($account)
{ {
if (! eregi(',',$account)) if (! preg_match('/,/',$account))
{ {
$moreparam='&month='.$month.'&year='.$year.($mode=='showalltime'?'&mode=showalltime':''); $moreparam='&month='.$month.'&year='.$year.($mode=='showalltime'?'&mode=showalltime':'');
if ($_GET["option"]!='all') if ($_GET["option"]!='all')

View File

@ -312,7 +312,7 @@ if ($result)
{ {
print '<td colspan="3">'; print '<td colspan="3">';
print '<input name="label" class="flat" value="'; print '<input name="label" class="flat" value="';
if (eregi('^\((.*)\)$',$objp->label,$reg)) if (preg_match('/^\((.*)\)$/i',$objp->label,$reg))
{ {
// Label generique car entre parentheses. On l'affiche en le traduisant // Label generique car entre parentheses. On l'affiche en le traduisant
print $langs->trans($reg[1]); print $langs->trans($reg[1]);
@ -328,7 +328,7 @@ if ($result)
else else
{ {
print '<td colspan="4">'; print '<td colspan="4">';
if (eregi('^\((.*)\)$',$objp->label,$reg)) if (preg_match('/^\((.*)\)$/i',$objp->label,$reg))
{ {
// Label generique car entre parentheses. On l'affiche en le traduisant // Label generique car entre parentheses. On l'affiche en le traduisant
print $langs->trans($reg[1]); print $langs->trans($reg[1]);

View File

@ -145,7 +145,7 @@ if ($resql)
if ($mesg) print $mesg."<br>"; if ($mesg) print $mesg."<br>";
// Affiche nom des derniers relevés // Affiche nom des derniers relev<EFBFBD>s
$nbmax=5; $nbmax=5;
$liste=""; $liste="";
@ -230,7 +230,7 @@ if ($resql)
// Description // Description
print '<td valign="center"><a href="'.DOL_URL_ROOT.'/compta/bank/ligne.php?rowid='.$objp->rowid.'&amp;account='.$acct->id.'">'; print '<td valign="center"><a href="'.DOL_URL_ROOT.'/compta/bank/ligne.php?rowid='.$objp->rowid.'&amp;account='.$acct->id.'">';
$reg=array(); $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]); if ($reg[1] && $langs->trans($reg[1])!=$reg[1]) print $langs->trans($reg[1]);
else print $objp->label; else print $objp->label;
print '</a>'; print '</a>';
@ -300,9 +300,9 @@ if ($resql)
else { else {
//print ' - '; //print ' - ';
print '<a href="'.$links[$key]['url'].$links[$key]['url_id'].'">'; print '<a href="'.$links[$key]['url'].$links[$key]['url_id'].'">';
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'; if ($reg[1]=='paiement') $reg[1]='Payment';
print $langs->trans($reg[1]); print $langs->trans($reg[1]);
} }
@ -327,12 +327,12 @@ if ($resql)
if ($objp->rappro) if ($objp->rappro)
{ {
// Si ligne déjà rapprochée, on affiche relevé. // Si ligne d<EFBFBD>j<EFBFBD> rapproch<63>e, on affiche relev<65>.
print "<td align=\"center\" nowrap=\"nowrap\"><a href=\"releve.php?num=$objp->num_releve&amp;account=$acct->id\">$objp->num_releve</a></td>"; print "<td align=\"center\" nowrap=\"nowrap\"><a href=\"releve.php?num=$objp->num_releve&amp;account=$acct->id\">$objp->num_releve</a></td>";
} }
else else
{ {
// Si pas encore rapprochée // Si pas encore rapproch<EFBFBD>e
if ($user->rights->banque->modifier) if ($user->rights->banque->modifier)
{ {
print '<td align="center" width="30" nowrap="nowrap">'; print '<td align="center" width="30" nowrap="nowrap">';
@ -347,7 +347,7 @@ if ($resql)
print '</a>'; print '</a>';
} }
else { else {
print "&nbsp;"; // 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 "&nbsp;"; // On n'empeche la suppression car le raprochement ne pourra se faire qu'apr<EFBFBD>s la date pass<73>e et que l'<27>criture apparaisse bien sur le compte.
} }
print "</td>"; print "</td>";
} }
@ -358,7 +358,7 @@ if ($resql)
} }
// Affiche zone saisie relevé + bouton "Rapprocher" // Affiche zone saisie relev<EFBFBD> + bouton "Rapprocher"
if ($objp->do <= gmmktime()) if ($objp->do <= gmmktime())
{ {
print '<td align="center" nowrap="nowrap">'; print '<td align="center" nowrap="nowrap">';

View File

@ -300,7 +300,7 @@ else
// Libelle // Libelle
print '<td valign="center"><a href="'.DOL_URL_ROOT.'/compta/bank/ligne.php?rowid='.$objp->rowid.'&amp;account='.$acct->id.'">'; print '<td valign="center"><a href="'.DOL_URL_ROOT.'/compta/bank/ligne.php?rowid='.$objp->rowid.'&amp;account='.$acct->id.'">';
$reg=array(); $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]); if ($reg[1] && $langs->trans($reg[1])!=$reg[1]) print $langs->trans($reg[1]);
else print $objp->label; else print $objp->label;
print '</a>'; print '</a>';

View File

@ -189,7 +189,7 @@ if ($resql)
print "<td><a href=\"ligne.php?rowid=$objp->rowid&amp;account=$objp->fk_account\">"; print "<td><a href=\"ligne.php?rowid=$objp->rowid&amp;account=$objp->fk_account\">";
$reg=array(); $reg=array();
eregi('\((.+)\)',$objp->label,$reg); // Si texte entour<EFBFBD> de parenth<74>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]); if ($reg[1] && $langs->trans($reg[1])!=$reg[1]) print $langs->trans($reg[1]);
else print dol_trunc($objp->label,40); else print dol_trunc($objp->label,40);
print "</a>&nbsp;"; print "</a>&nbsp;";

View File

@ -127,7 +127,7 @@ print '<br>';
clearstatcache(); clearstatcache();
// Affiche lien sur autres ann<EFBFBD>es // Affiche lien sur autres annees
$linkforyear=array(); $linkforyear=array();
$found=0; $found=0;
if (is_dir($dir)) if (is_dir($dir))
@ -135,7 +135,7 @@ if (is_dir($dir))
$handle=opendir($dir); $handle=opendir($dir);
while (($file = readdir($handle))!==false) while (($file = readdir($handle))!==false)
{ {
if (is_dir($dir.'/'.$file) && ! eregi('^\.',$file)) if (is_dir($dir.'/'.$file) && ! preg_match('/^\./',$file))
{ {
$found=1; $found=1;
$linkforyear[]=$file; $linkforyear[]=$file;
@ -165,7 +165,7 @@ if ($year)
$var=true; $var=true;
while (($file = readdir($handle))!==false) while (($file = readdir($handle))!==false)
{ {
if (eregi('^payment',$file)) if (preg_match('/^payment/i',$file))
{ {
$var=!$var; $var=!$var;
$tfile = $dir . '/'.$year.'/'.$file; $tfile = $dir . '/'.$year.'/'.$file;

View File

@ -151,7 +151,7 @@ if ($modecompta != 'CREANCES-DETTES') {
$encaiss_ttc[$row->dm] += $row->amount_ttc; $encaiss_ttc[$row->dm] += $row->amount_ttc;
// For DEBUG Only // For DEBUG Only
if (eregi('^2007',$row->dm)) if (preg_match('/^2007/',$row->dm))
{ {
$subtotal_ht = $subtotal_ht + $row->amount_ht; $subtotal_ht = $subtotal_ht + $row->amount_ht;
$subtotal_ttc = $subtotal_ttc + $row->amount_ttc; $subtotal_ttc = $subtotal_ttc + $row->amount_ttc;
@ -210,7 +210,7 @@ if ($result)
$decaiss_ttc[$row->dm] = $row->amount_ttc; $decaiss_ttc[$row->dm] = $row->amount_ttc;
// For DEBUG Only // For DEBUG Only
if (eregi('^2007',$row->dm)) if (preg_match('/^2007/',$row->dm))
{ {
$subtotal_ht = $subtotal_ht + $row->amount_ht; $subtotal_ht = $subtotal_ht + $row->amount_ht;
$subtotal_ttc = $subtotal_ttc + $row->amount_ttc; $subtotal_ttc = $subtotal_ttc + $row->amount_ttc;
@ -311,7 +311,7 @@ else {
$decaiss[$obj->dm] += $obj->amount; $decaiss[$obj->dm] += $obj->amount;
$decaiss_ttc[$obj->dm] += $obj->amount; $decaiss_ttc[$obj->dm] += $obj->amount;
// For DEBUG Only // For DEBUG Only
if (eregi('^2007',$obj->dm)) if (preg_match('/^2007/',$obj->dm))
{ {
$subtotal_ht = $subtotal_ht + $obj->amount; $subtotal_ht = $subtotal_ht + $obj->amount;
$subtotal_ttc = $subtotal_ttc + $obj->amount; $subtotal_ttc = $subtotal_ttc + $obj->amount;
@ -342,7 +342,7 @@ else {
$encaiss[$obj->dm] += $obj->amount; $encaiss[$obj->dm] += $obj->amount;
$encaiss_ttc[$obj->dm] += $obj->amount; $encaiss_ttc[$obj->dm] += $obj->amount;
// For DEBUG Only // For DEBUG Only
if (eregi('^2007',$obj->dm)) if (preg_match('/^2007/',$obj->dm))
{ {
$subtotal_ht = $subtotal_ht + $obj->amount; $subtotal_ht = $subtotal_ht + $obj->amount;
$subtotal_ttc = $subtotal_ttc + $obj->amount; $subtotal_ttc = $subtotal_ttc + $obj->amount;
@ -410,7 +410,7 @@ if ($result) {
$decaiss_ttc[$obj->dm] += $obj->amount_ttc; $decaiss_ttc[$obj->dm] += $obj->amount_ttc;
// For DEBUG Only // For DEBUG Only
if (eregi('^2007',$obj->dm)) if (preg_match('/^2007/',$obj->dm))
{ {
$subtotal_ht = $subtotal_ht + $obj->amount_ht; $subtotal_ht = $subtotal_ht + $obj->amount_ht;
$subtotal_ttc = $subtotal_ttc + $obj->amount_ttc; $subtotal_ttc = $subtotal_ttc + $obj->amount_ttc;
@ -478,7 +478,7 @@ if ($result) {
$decaiss_ttc[$obj->dm] += $obj->amount_ttc; $decaiss_ttc[$obj->dm] += $obj->amount_ttc;
// For DEBUG Only // For DEBUG Only
if (eregi('^2007',$obj->dm)) if (preg_match('/^2007/',$obj->dm))
{ {
$subtotal_ht = $subtotal_ht + $obj->amount_ht; $subtotal_ht = $subtotal_ht + $obj->amount_ht;
$subtotal_ttc = $subtotal_ttc + $obj->amount_ttc; $subtotal_ttc = $subtotal_ttc + $obj->amount_ttc;

View File

@ -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) if (! defined("$key")) define ("$key", $value); // In some cases, the constant might be already forced (Example: SYSLOG_FILE during install)
$this->global->$key=$value; $this->global->$key=$value;
// If this is constant for a css file activated by a module // 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; $this->css_modules[]=$value;
} }
// If this is constant for a new tab page activated by a module // 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); $params=explode(':',$value,2);
$this->tabs_modules[$params[0]][]=$value; $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) // If this is constant to force a module directories (used to manage some exceptions)
// Should not be used by modules // 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]); $module=strtolower($reg[1]);
// If with submodule name // 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]); $dir_name = "dir_".strtolower($reg[2]);
$submodule = strtolower($reg[1]); $submodule = strtolower($reg[1]);
$this->$module->$submodule->$dir_name = $value; // We put only dir name. We will add DOL_DATA_ROOT later $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.'<br>'; //print '->'.$module.'->'.$submodule.'->'.$dir_name.' = '.$this->$module->$submodule->$dir_name.'<br>';
} }
else if (eregi('_DIR_([A-Z]+)$',$key,$reg)) else if (preg_match('/_DIR_([A-Z]+)$/i',$key,$reg))
{ {
$dir_name = "dir_".strtolower($reg[1]); $dir_name = "dir_".strtolower($reg[1]);
$this->$module->$dir_name = $value; // We put only dir name. We will add DOL_DATA_ROOT later $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 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]); $module=strtolower($reg[1]);
// Add this module in list of modules that need smarty // Add this module in list of modules that need smarty
$this->need_smarty[]=$module; $this->need_smarty[]=$module;
} }
// If this is a module constant // 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]); $module=strtolower($reg[1]);
//print "Module ".$module." is enabled<br>\n"; //print "Module ".$module." is enabled<br>\n";

View File

@ -392,7 +392,7 @@ class Menubase
$title = $langs->trans($menu['titre']); $title = $langs->trans($menu['titre']);
$langs->load($menu['langs']); $langs->load($menu['langs']);
} }
if (eregi("/",$title)) if (preg_match("/\//",$title))
{ {
$tab_titre = explode("/",$title); $tab_titre = explode("/",$title);
$chaine = $langs->trans($tab_titre[0])."/".$langs->trans($tab_titre[1]); $chaine = $langs->trans($tab_titre[0])."/".$langs->trans($tab_titre[1]);
@ -424,9 +424,9 @@ class Menubase
$tabMenu[$b][0] = $menu['rowid']; $tabMenu[$b][0] = $menu['rowid'];
$tabMenu[$b][1] = $menu['fk_menu']; $tabMenu[$b][1] = $menu['fk_menu'];
$tabMenu[$b][2] = $menu['url']; $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].='&amp;idmenu='.$menu['rowid']; if (preg_match('/\?/',$tabMenu[$b][2])) $tabMenu[$b][2].='&amp;idmenu='.$menu['rowid'];
else $tabMenu[$b][2].='?idmenu='.$menu['rowid']; else $tabMenu[$b][2].='?idmenu='.$menu['rowid'];
} }
$tabMenu[$b][3] = $chaine; $tabMenu[$b][3] = $chaine;
@ -500,7 +500,7 @@ class Menubase
{ {
// print "x".$pere." ".$tab[$x][6]; // 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); $this->recur($tab, $tab[$x][0], $rang +1);
} }
} }
@ -622,7 +622,7 @@ class Menubase
$langs->load($objm->langs); $langs->load($objm->langs);
} }
if (eregi("/",$title)) if (preg_match("/\//",$title))
{ {
$tab_titre = explode("/",$title); $tab_titre = explode("/",$title);
$chaine = $langs->trans($tab_titre[0])."/".$langs->trans($tab_titre[1]); $chaine = $langs->trans($tab_titre[0])."/".$langs->trans($tab_titre[1]);

View File

@ -238,7 +238,7 @@ print '<table class="border" width="100%"><tr><td width="40%" valign="top">';
print '<table class="nobordernopadding" width="100%"><tr><td valign="top">'; print '<table class="nobordernopadding" width="100%"><tr><td valign="top">';
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); $userstatic = new User($db);
$ecmdirstatic = new ECMDirectory($db); $ecmdirstatic = new ECMDirectory($db);
@ -451,7 +451,7 @@ if (empty($action) || $action == 'file_manager' || eregi('refresh',$action) || $
$ecmdirstatic->ref=$val['label']; $ecmdirstatic->ref=$val['label'];
// Refresh cache // Refresh cache
if (eregi('refresh',$_GET['action'])) if (preg_match('/refresh/i',$_GET['action']))
{ {
$result=$ecmdirstatic->fetch($val['id']); $result=$ecmdirstatic->fetch($val['id']);
$ecmdirstatic->ref=$ecmdirstatic->label; $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 // If directory is brother of selected directory, we show line
elseif ($val['id'] != $section && $val['id_mere'] == $ecmdirstatic->motherof[$section]) $showline=3; 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 // 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 // If we are level one we show line
elseif ($val['level'] < 2) $showline=1; elseif ($val['level'] < 2) $showline=1;
@ -604,7 +604,7 @@ print '</td></tr>';
// Actions buttons // Actions buttons
print '<tr height="22"><td align="center">'; print '<tr height="22"><td align="center">';
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) if ($user->rights->ecm->setup)
{ {

View File

@ -61,7 +61,7 @@ if ($_POST["action"] == 'dispatch' && $user->rights->fournisseur->commande->rece
foreach($_POST as $key => $value) 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]; $prod = "product_".$reg[1];
$qty = "qty_".$reg[1]; $qty = "qty_".$reg[1];

View File

@ -532,7 +532,7 @@ if ($id > 0 || ! empty($ref))
$commande->date_commande=gmmktime(); $commande->date_commande=gmmktime();
// We check if number is temporary number // 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; else $newref = $commande->ref;
$text=$langs->trans('ConfirmValidateOrder',$newref); $text=$langs->trans('ConfirmValidateOrder',$newref);

View File

@ -484,7 +484,7 @@ class PaiementFourn
$lienfin='</a>'; $lienfin='</a>';
$text=$this->ref; // Sometimes ref contains label $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 // Label g诩rique car entre parenth粥s. On l'affiche en le traduisant
if ($reg[1]=='paiement') $reg[1]='Payment'; if ($reg[1]=='paiement') $reg[1]='Payment';

View File

@ -246,7 +246,7 @@ class CommandeFournisseur extends Commande
$soc->fetch($this->fourn_id); $soc->fetch($this->fourn_id);
// Check if object has a temporary ref // Check if object has a temporary ref
if (eregi('^\(PROV', $this->ref)) if (preg_match('/^\(PROV/i', $this->ref))
{ {
$num = $this->getNextNumRef($soc); $num = $this->getNextNumRef($soc);
} }

View File

@ -561,7 +561,7 @@ if ($step == 3 && $datatoimport)
// readdir return value in ISO and we want UTF8 in memory // readdir return value in ISO and we want UTF8 in memory
if (! utf8_check($file)) $file=utf8_encode($file); if (! utf8_check($file)) $file=utf8_encode($file);
if (eregi('^\.',$file)) continue; if (preg_match('/^\./',$file)) continue;
$modulepart='import'; $modulepart='import';
$urlsource=$_SERVER["PHP_SELF"].'?step='.$step.$param.'&filetoimport='.urlencode($filetoimport); $urlsource=$_SERVER["PHP_SELF"].'?step='.$step.$param.'&filetoimport='.urlencode($filetoimport);
@ -841,10 +841,10 @@ if ($step == 4 && $datatoimport)
print '<td nowrap="nowrap" style="font-weight: normal">=>'.img_object('',$entityicon).' '.$langs->trans($entitylang).'</td>'; print '<td nowrap="nowrap" style="font-weight: normal">=>'.img_object('',$entityicon).' '.$langs->trans($entitylang).'</td>';
print '<td style="font-weight: normal">'; print '<td style="font-weight: normal">';
$newlabel=preg_replace('/\*$/i','',$label); $newlabel=preg_replace('/\*$/','',$label);
$text=$langs->trans($newlabel); $text=$langs->trans($newlabel);
$more=''; $more='';
if (eregi('\*$',$label)) if (preg_match('/\*$/',$label))
{ {
$text='<b>'.$text.'*</b>'; $text='<b>'.$text.'*</b>';
$more=((! empty($valforsourcefieldnb[$i]) && $valforsourcefieldnb[$i] <= sizeof($fieldssource)) ? '' : img_warning($langs->trans("FieldNeedSource"))); $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").": <b>".$tablename."</b><br>"; $htmltext =$langs->trans("Table").": <b>".$tablename."</b><br>";
$htmltext.=$langs->trans("Field").': <b>'.$code."</b><br>"; $htmltext.=$langs->trans("Field").': <b>'.$code."</b><br>";
$htmltext.=$langs->trans("Required").': <b>'.yn(eregi('\*$',$label)).'</b>'; $htmltext.=$langs->trans("Required").': <b>'.yn(preg_match('/\*$/',$label)).'</b>';
$note=$objimport->array_import_examplevalues[0][$code]; $note=$objimport->array_import_examplevalues[0][$code];
if ($note) $htmltext.='<br>'.$langs->trans("Note").'/'.$langs->trans("Example").': '.$note; if ($note) $htmltext.='<br>'.$langs->trans("Note").'/'.$langs->trans("Example").': '.$note;
$text.=$more; $text.=$more;

View File

@ -47,7 +47,7 @@ function barcode_encode_ean($ean, $encoding = "EAN-13"){
$guards=array("9a1a","1a1a1","a1a"); $guards=array("9a1a","1a1a1","a1a");
$ean=trim($ean); $ean=trim($ean);
if (eregi("[^0-9]",$ean)){ if (preg_match("/[^0-9]/i",$ean)){
return array("text"=>"Invalid EAN-Code"); return array("text"=>"Invalid EAN-Code");
} }
$encoding=strtoupper($encoding); $encoding=strtoupper($encoding);

View File

@ -342,7 +342,7 @@ function barcode_outhtml($code, $bars, $scale = 1, $total_y = 0, $space = ''){
function barcode_encode_genbarcode($code,$encoding){ function barcode_encode_genbarcode($code,$encoding){
global $genbarcode_loc; global $genbarcode_loc;
/* delete EAN-13 checksum */ /* 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"; if (!$encoding) $encoding="ANY";
$encoding=preg_replace("/[|\\]/", "_", $encoding); $encoding=preg_replace("/[|\\]/", "_", $encoding);
$code=preg_replace("/[|\\]/", "_", $code); $code=preg_replace("/[|\\]/", "_", $code);
@ -398,12 +398,12 @@ function barcode_encode($code,$encoding){
((preg_match("/^ean$/i", $encoding) ((preg_match("/^ean$/i", $encoding)
&& ( strlen($code)==12 || strlen($code)==13))) && ( strlen($code)==12 || strlen($code)==13)))
|| (($encoding) && (eregi("^isbn$", $encoding)) || (($encoding) && (preg_match("/^isbn$/i", $encoding))
&& (( strlen($code)==9 || strlen($code)==10) || && (( strlen($code)==9 || strlen($code)==10) ||
(((preg_match("/^978/", $code) && strlen($code)==12) || (((preg_match("/^978/", $code) && strlen($code)==12) ||
(strlen($code)==13))))) (strlen($code)==13)))))
|| (( !isset($encoding) || !$encoding || (eregi("^ANY$", $encoding) )) || (( !isset($encoding) || !$encoding || (preg_match("/^ANY$/i", $encoding) ))
&& (preg_match("/^[0-9]{12,13}$/", $code))) && (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); $bars=barcode_encode($code,$encoding);
if (!$bars) return; if (!$bars) return;
if (!$mode) $mode="png"; if (!$mode) $mode="png";
if (eregi($mode,"^(text|txt|plain)$")) print barcode_outtext($bars['text'],$bars['bars']); if (preg_match("/^(text|txt|plain)$/i",$mode)) print barcode_outtext($bars['text'],$bars['bars']);
elseif (eregi($mode,"^(html|htm)$")) print barcode_outhtml($bars['text'],$bars['bars'], $scale,0, 0); 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); else barcode_outimage($bars['text'],$bars['bars'],$scale, $mode);
return $bars; return $bars;
} }

View File

@ -2292,13 +2292,13 @@ function _enddoc()
} }
case 'span': { case 'span': {
if (isset($attr['style']) && $attr['style']!='') { if (isset($attr['style']) && $attr['style']!='') {
if (eregi("color",$attr['style'])){ if (preg_match("/color/i",$attr['style'])){
if (eregi("rgb",$attr['style'])){ if (preg_match("/rgb/i",$attr['style'])){
//print 'style rgb '.$attr['style'].'<br>'; //print 'style rgb '.$attr['style'].'<br>';
$coul = substr($attr['style'],11,-2); $coul = substr($attr['style'],11,-2);
list($R, $G, $B) = explode(', ', $coul); list($R, $G, $B) = explode(', ', $coul);
} }
else if (eregi("#",$attr['style'])){ else if (preg_match("/#/",$attr['style'])){
//print 'style hexa '.$attr['style'].'<br>'; //print 'style hexa '.$attr['style'].'<br>';
$R = hexdec(substr($attr['style'],8,2)); $R = hexdec(substr($attr['style'],8,2));
$G = hexdec(substr($attr['style'],10,2)); $G = hexdec(substr($attr['style'],10,2));
@ -2308,7 +2308,7 @@ function _enddoc()
$this->SetTextColor($R,$G,$B); $this->SetTextColor($R,$G,$B);
$this->issetcolor=true; $this->issetcolor=true;
} }
if (eregi("font-family",$attr['style'])){ if (preg_match("/font-family/i",$attr['style'])){
$fontName = substr($attr['style'],13,-1); $fontName = substr($attr['style'],13,-1);
$fontName = $this->convertNameFont($fontName); $fontName = $this->convertNameFont($fontName);
if (isset($fontName) && in_array(strtolower($fontName), $this->fontlist)) { if (isset($fontName) && in_array(strtolower($fontName), $this->fontlist)) {
@ -2317,7 +2317,7 @@ function _enddoc()
//print 'fontfamily: '.$this->FontFamily.'<br>'; //print 'fontfamily: '.$this->FontFamily.'<br>';
} }
} }
if (eregi("font-size",$attr['style'])){ if (preg_match("/font-size/i",$attr['style'])){
$headsize = substr($attr['style'],11); $headsize = substr($attr['style'],11);
$headsize = preg_replace('/[;-]/','',$headsize); $headsize = preg_replace('/[;-]/','',$headsize);
//print 'headsize1: '.$headsize.'<br>'; //print 'headsize1: '.$headsize.'<br>';

View File

@ -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. // 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']; $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.='&'; else $url.='&';
$url.='mainmenu='.$mainmenu; $url.='mainmenu='.$mainmenu;
} }

View File

@ -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. // 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']; $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.='&'; else $url.='&';
$url.='mainmenu='.$mainmenu; $url.='mainmenu='.$mainmenu;
} }

View File

@ -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); $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 ($user->societe_id == 0)
{ {
if (eregi("customers_bills",$leftmenu)) $newmenu->add(DOL_URL_ROOT."/compta/clients.php?action=facturer&amp;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&amp;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 ($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 // Proposals
@ -484,17 +484,17 @@ class MenuLeft {
if ($conf->tax->enabled) if ($conf->tax->enabled)
{ {
$newmenu->add(DOL_URL_ROOT."/compta/charges/index.php?leftmenu=tax&amp;mainmenu=accountancy",$langs->trans("MenuTaxAndDividends"), 0, $user->rights->tax->charges->lire); $newmenu->add(DOL_URL_ROOT."/compta/charges/index.php?leftmenu=tax&amp;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&amp;mainmenu=accountancy&amp;mode=sconly",$langs->trans("MenuSocialContributions"),1,$user->rights->tax->charges->lire); if (preg_match('/^tax/i',$leftmenu)) $newmenu->add(DOL_URL_ROOT."/compta/charges/index.php?leftmenu=tax_social&amp;mainmenu=accountancy&amp;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 (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 (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/sociales/index.php?leftmenu=tax_social",$langs->trans("List"), 2, $user->rights->tax->charges->lire);
// VAT // VAT
if ($conf->compta->tva) if ($conf->compta->tva)
{ {
if (eregi('^tax',$leftmenu)) $newmenu->add(DOL_URL_ROOT."/compta/tva/index.php?leftmenu=tax_vat&amp;mainmenu=accountancy",$langs->trans("VAT"),1,$user->rights->tax->charges->lire); if (preg_match('/^tax/i',$leftmenu)) $newmenu->add(DOL_URL_ROOT."/compta/tva/index.php?leftmenu=tax_vat&amp;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 (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 (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 (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 (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 (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 (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/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) 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); $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&amp;action=new",$langs->trans("NewChequeDeposit"),1,$user->rights->banque->cheque); if (preg_match("/checks/i",$leftmenu)) $newmenu->add(DOL_URL_ROOT."/compta/paiement/cheque/fiche.php?leftmenu=checks&amp;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/liste.php?leftmenu=checks",$langs->trans("MenuChequesReceipts"),1,$user->rights->banque->cheque);
} }
// Bank-Caisse // Bank-Caisse
@ -851,8 +851,8 @@ class MenuLeft {
{ {
$langs->load("bills"); $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); $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&amp;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/fiche.php?leftmenu=members_checks&amp;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/liste.php?leftmenu=members_checks",$langs->trans("MenuChequesReceipts"),1,$user->rights->adherent->cotisation->lire);
} }
if ($conf->banque->enabled) if ($conf->banque->enabled)

View File

@ -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); $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 ($user->societe_id == 0)
{ {
if (eregi("customers_bills",$leftmenu)) $newmenu->add(DOL_URL_ROOT."/compta/clients.php?action=facturer&amp;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&amp;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 ($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 // Proposals
@ -492,17 +492,17 @@ class MenuLeft {
if ($conf->tax->enabled) if ($conf->tax->enabled)
{ {
$newmenu->add(DOL_URL_ROOT."/compta/charges/index.php?leftmenu=tax&amp;mainmenu=accountancy",$langs->trans("MenuTaxAndDividends"), 0, $user->rights->tax->charges->lire); $newmenu->add(DOL_URL_ROOT."/compta/charges/index.php?leftmenu=tax&amp;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&amp;mainmenu=accountancy&amp;mode=sconly",$langs->trans("MenuSocialContributions"),1,$user->rights->tax->charges->lire); if (preg_match('/^tax/i',$leftmenu)) $newmenu->add(DOL_URL_ROOT."/compta/charges/index.php?leftmenu=tax_social&amp;mainmenu=accountancy&amp;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 (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 (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/sociales/index.php?leftmenu=tax_social",$langs->trans("List"), 2, $user->rights->tax->charges->lire);
// VAT // VAT
if ($conf->compta->tva) if ($conf->compta->tva)
{ {
if (eregi('^tax',$leftmenu)) $newmenu->add(DOL_URL_ROOT."/compta/tva/index.php?leftmenu=tax_vat&amp;mainmenu=accountancy",$langs->trans("VAT"),1,$user->rights->tax->charges->lire); if (preg_match('/^tax/i',$leftmenu)) $newmenu->add(DOL_URL_ROOT."/compta/tva/index.php?leftmenu=tax_vat&amp;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 (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 (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 (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 (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 (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 (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/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) 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); $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&amp;action=new",$langs->trans("NewChequeDeposit"),1,$user->rights->banque->cheque); if (preg_match("/checks/i",$leftmenu)) $newmenu->add(DOL_URL_ROOT."/compta/paiement/cheque/fiche.php?leftmenu=checks&amp;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/liste.php?leftmenu=checks",$langs->trans("MenuChequesReceipts"),1,$user->rights->banque->cheque);
} }
*/ */
@ -857,8 +857,8 @@ class MenuLeft {
{ {
$langs->load("bills"); $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); $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&amp;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/fiche.php?leftmenu=members_checks&amp;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/liste.php?leftmenu=members_checks",$langs->trans("MenuChequesReceipts"),1,$user->rights->adherent->cotisation->lire);
} }
if ($conf->banque->enabled) if ($conf->banque->enabled)

View File

@ -90,7 +90,7 @@ class MenuTop {
$url=DOL_URL_ROOT.$tabMenu[$i]['url']; $url=DOL_URL_ROOT.$tabMenu[$i]['url'];
if (! preg_match('/\?/',$url)) $url.='?'; if (! preg_match('/\?/',$url)) $url.='?';
else $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=&'; $url.='mainmenu='.$tabMenu[$i]['mainmenu'].'&leftmenu=&';
} }

View File

@ -81,16 +81,16 @@ class MenuTop {
if ($tabMenu[$i]['right'] == true) // Is allowed if ($tabMenu[$i]['right'] == true) // Is allowed
{ {
// Define url // Define url
if (eregi("^(http:\/\/|https:\/\/)",$tabMenu[$i]['url'])) if (preg_match("/^(http:\/\/|https:\/\/)/i",$tabMenu[$i]['url']))
{ {
$url = $tabMenu[$i]['url']; $url = $tabMenu[$i]['url'];
} }
else else
{ {
$url=DOL_URL_ROOT.$tabMenu[$i]['url']; $url=DOL_URL_ROOT.$tabMenu[$i]['url'];
if (! eregi('\?',$url)) $url.='?'; if (! preg_match('/\?/',$url)) $url.='?';
else $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=&'; $url.='mainmenu='.$tabMenu[$i]['mainmenu'].'&leftmenu=&';
} }

View File

@ -418,16 +418,16 @@ class MenuTop {
$idsel=(empty($tabMenu[$i]['mainmenu'])?'none':$tabMenu[$i]['mainmenu']); $idsel=(empty($tabMenu[$i]['mainmenu'])?'none':$tabMenu[$i]['mainmenu']);
if ($tabMenu[$i]['right'] == true) // Is allowed 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']; $url = $tabMenu[$i]['url'];
} }
else else
{ {
$url=DOL_URL_ROOT.$tabMenu[$i]['url']; $url=DOL_URL_ROOT.$tabMenu[$i]['url'];
if (! eregi('\?',$url)) $url.='?'; if (! preg_match('/\?/',$url)) $url.='?';
else $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=&'; $url.='mainmenu='.$tabMenu[$i]['mainmenu'].'&leftmenu=&';
} }

View File

@ -417,16 +417,16 @@ class MenuTop {
$idsel=(empty($tabMenu[$i]['mainmenu'])?'none':$tabMenu[$i]['mainmenu']); $idsel=(empty($tabMenu[$i]['mainmenu'])?'none':$tabMenu[$i]['mainmenu']);
if ($tabMenu[$i]['right'] == true) // Is allowed 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']; $url = $tabMenu[$i]['url'];
} }
else else
{ {
$url=DOL_URL_ROOT.$tabMenu[$i]['url']; $url=DOL_URL_ROOT.$tabMenu[$i]['url'];
if (! eregi('\?',$url)) $url.='?'; if (! preg_match('/\?/',$url)) $url.='?';
else $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=&'; $url.='mainmenu='.$tabMenu[$i]['mainmenu'].'&leftmenu=&';
} }

View File

@ -86,7 +86,7 @@ class MenuTop {
if ($tabMenu[$i]['right'] == true) if ($tabMenu[$i]['right'] == true)
{ {
$url=DOL_URL_ROOT.$tabMenu[$i]['url']; $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.='&'; else $url.='&';
$url.='mainmenu='.$tabMenu[$i]['mainmenu'].'&leftmenu='; $url.='mainmenu='.$tabMenu[$i]['mainmenu'].'&leftmenu=';
$url.="&idmenu=".$tabMenu[$i]['rowid']; $url.="&idmenu=".$tabMenu[$i]['rowid'];

View File

@ -360,14 +360,14 @@ class MenuTop {
$idsel=(empty($tabMenu[$i]['mainmenu'])?'id="none" ':'id="'.$tabMenu[$i]['mainmenu'].'" '); $idsel=(empty($tabMenu[$i]['mainmenu'])?'id="none" ':'id="'.$tabMenu[$i]['mainmenu'].'" ');
if ($tabMenu[$i]['right'] == true) 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']; $url = $tabMenu[$i]['url'];
} }
else else
{ {
$url=DOL_URL_ROOT.$tabMenu[$i]['url']; $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.='&'; else $url.='&';
$url.='mainmenu='.$tabMenu[$i]['mainmenu'].'&leftmenu='; $url.='mainmenu='.$tabMenu[$i]['mainmenu'].'&leftmenu=';
$url.="&idmenu=".$tabMenu[$i]['rowid']; $url.="&idmenu=".$tabMenu[$i]['rowid'];

View File

@ -451,7 +451,7 @@ class DolibarrModules
{ {
while (($file = readdir($handle))!==false) 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); $result=run_sql($dir.$file,1);
} }
@ -465,7 +465,7 @@ class DolibarrModules
{ {
while (($file = readdir($handle))!==false) 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); $result=run_sql($dir.$file,1);
} }
@ -479,7 +479,7 @@ class DolibarrModules
{ {
while (($file = readdir($handle))!==false) 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); $result=run_sql($dir.$file,1);
} }

View File

@ -79,7 +79,7 @@ class mod_commande_marbre extends ModeleNumRefCommandes
$row = $db->fetch_row($resql); $row = $db->fetch_row($resql);
if ($row) $coyymm = substr($row[0],0,6); 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.'; $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; return false;

View File

@ -568,7 +568,7 @@ class pdf_einstein extends ModelePDFCommandes
$pdf->SetXY ($col1x, $tab2_top + $tab2_hl * $index); $pdf->SetXY ($col1x, $tab2_top + $tab2_hl * $index);
$tvacompl=''; $tvacompl='';
if (eregi('\*',$tvakey)) if (preg_match('/\*/',$tvakey))
{ {
$tvakey=str_replace('*','',$tvakey); $tvakey=str_replace('*','',$tvakey);
$tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")"; $tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")";

View File

@ -199,7 +199,7 @@ class ExportCsv extends ModeleExports
$newvalue=$outputlangs->convToOutputCharset($objp->$alias); $newvalue=$outputlangs->convToOutputCharset($objp->$alias);
// Translation newvalue // Translation newvalue
if (eregi('^\((.*)\)$',$newvalue,$reg)) if (preg_match('/^\((.*)\)$/i',$newvalue,$reg))
{ {
$newvalue=$outputlangs->transnoentities($reg[1]); $newvalue=$outputlangs->transnoentities($reg[1]);
} }

View File

@ -203,7 +203,7 @@ class ExportExcel extends ModeleExports
$newvalue=$this->excel_clean($newvalue); $newvalue=$this->excel_clean($newvalue);
// Traduction newvalue // Traduction newvalue
if (eregi('^\((.*)\)$',$newvalue,$reg)) if (preg_match('/^\((.*)\)$/i',$newvalue,$reg))
{ {
$newvalue=$outputlangs->transnoentities($reg[1]); $newvalue=$outputlangs->transnoentities($reg[1]);
} }
@ -212,14 +212,14 @@ class ExportExcel extends ModeleExports
$newvalue=$outputlangs->convToOutputCharset($newvalue); $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)); $arrayvalue=preg_split('/[.,]/',xl_parse_date($newvalue));
//print "x".$arrayvalue[0].'.'.strval($arrayvalue[1]).'<br>'; //print "x".$arrayvalue[0].'.'.strval($arrayvalue[1]).'<br>';
$newvalue=strval($arrayvalue[0]).'.'.strval($arrayvalue[1]); // $newvalue=strval(36892.521); directly does not work because . will be convert into , later $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); $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)); $arrayvalue=preg_split('/[.,]/',xl_parse_date($newvalue));
//print "x".$arrayvalue[0].'.'.strval($arrayvalue[1]).'<br>'; //print "x".$arrayvalue[0].'.'.strval($arrayvalue[1]).'<br>';

View File

@ -171,7 +171,7 @@ class ExportTsv extends ModeleExports
$newvalue=$objp->$alias; $newvalue=$objp->$alias;
// Translation newvalue // Translation newvalue
if (eregi('^\((.*)\)$',$newvalue,$reg)) if (preg_match('/^\((.*)\)$/i',$newvalue,$reg))
{ {
$newvalue=$outputlangs->transnoentities($reg[1]); $newvalue=$outputlangs->transnoentities($reg[1]);
} }

View File

@ -66,7 +66,7 @@ class ModeleExports
$i=0; $i=0;
while (($file = readdir($handle))!==false) while (($file = readdir($handle))!==false)
{ {
if (eregi("^export_(.*)\.modules\.php$",$file,$reg)) if (preg_match("/^export_(.*)\.modules\.php$/i",$file,$reg))
{ {
$moduleid=$reg[1]; $moduleid=$reg[1];

View File

@ -716,7 +716,7 @@ class pdf_crabe extends ModelePDFFactures
$index++; $index++;
$pdf->SetXY ($col1x, $tab2_top + $tab2_hl * $index); $pdf->SetXY ($col1x, $tab2_top + $tab2_hl * $index);
$tvacompl=''; $tvacompl='';
if (eregi('\*',$tvakey)) if (preg_match('/\*/',$tvakey))
{ {
$tvakey=str_replace('*','',$tvakey); $tvakey=str_replace('*','',$tvakey);
$tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")"; $tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")";

View File

@ -639,7 +639,7 @@ class pdf_oursin extends ModelePDFFactures
$index++; $index++;
$pdf->SetXY ($col1x, $tab2_top + $tab2_hl * $index); $pdf->SetXY ($col1x, $tab2_top + $tab2_hl * $index);
$tvacompl=''; $tvacompl='';
if (eregi('\*',$tvakey)) if (preg_match('/\*/',$tvakey))
{ {
$tvakey=str_replace('*','',$tvakey); $tvakey=str_replace('*','',$tvakey);
$tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")"; $tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")";

View File

@ -82,7 +82,7 @@ class mod_facture_terre extends ModeleNumRefFactures
$row = $db->fetch_row($resql); $row = $db->fetch_row($resql);
if ($row) $fayymm = substr($row[0],0,6); 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'); $this->error=$langs->trans('TerreNumRefModelError');
return false; return false;
@ -102,7 +102,7 @@ class mod_facture_terre extends ModeleNumRefFactures
$row = $db->fetch_row($resql); $row = $db->fetch_row($resql);
if ($row) $fayymm = substr($row[0],0,6); 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'); $this->error=$langs->trans('TerreNumRefModelError');
return false; return false;

View File

@ -21,7 +21,7 @@
/** /**
\file htdocs/includes/modules/fichinter/mod_pacific.php \file htdocs/includes/modules/fichinter/mod_pacific.php
\ingroup fiche intervention \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$ \version $Id$
*/ */
@ -29,7 +29,7 @@ require_once(DOL_DOCUMENT_ROOT ."/includes/modules/fichinter/modules_fichinter.p
/** /**
\class mod_pacific \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 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 * \return string Texte descripif
*/ */
function info() function info()
@ -58,7 +58,7 @@ class mod_pacific extends ModeleNumRefFicheinter
return $langs->trans('PacificNumRefModelDesc1',$this->prefix); return $langs->trans('PacificNumRefModelDesc1',$this->prefix);
} }
/** \brief Renvoi un exemple de numérotation /** \brief Renvoi un exemple de numerotation
* \return string Example * \return string Example
*/ */
function getExample() function getExample()
@ -66,8 +66,8 @@ class mod_pacific extends ModeleNumRefFicheinter
return $this->prefix."0501-0001"; return $this->prefix."0501-0001";
} }
/** \brief Test si les numéros déjà en vigueur dans la base ne provoquent pas de /** \brief Test si les numeros deja en vigueur dans la base ne provoquent pas de
* de conflits qui empechera cette numérotation de fonctionner. * de conflits qui empechera cette numerotation de fonctionner.
* \return boolean false si conflit, true si ok * \return boolean false si conflit, true si ok
*/ */
function canBeActivated() function canBeActivated()
@ -88,7 +88,7 @@ class mod_pacific extends ModeleNumRefFicheinter
$row = $db->fetch_row($resql); $row = $db->fetch_row($resql);
if ($row) $fayymm = substr($row[0],0,6); 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; return true;
} }
@ -99,8 +99,8 @@ class mod_pacific extends ModeleNumRefFicheinter
} }
} }
/** \brief Renvoi prochaine valeur attribuée /** \brief Renvoi prochaine valeur attribuee
* \param objsoc Objet société * \param objsoc Objet societe
* \param ficheinter Object ficheinter * \param ficheinter Object ficheinter
* \return string Valeur * \return string Valeur
*/ */
@ -108,7 +108,7 @@ class mod_pacific extends ModeleNumRefFicheinter
{ {
global $db,$conf; 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; $posindice=8;
$sql = "SELECT MAX(0+SUBSTRING(ref,".$posindice.")) as max"; $sql = "SELECT MAX(0+SUBSTRING(ref,".$posindice.")) as max";

View File

@ -108,7 +108,7 @@ class pdf_soleil extends ModelePDFFicheinter
$fichref = dol_sanitizeFileName($fichinter->ref); $fichref = dol_sanitizeFileName($fichinter->ref);
$dir = $conf->ficheinter->dir_output; $dir = $conf->ficheinter->dir_output;
if (! eregi('specimen',$fichref)) $dir.= "/" . $fichref; if (! preg_match('/specimen/i',$fichref)) $dir.= "/" . $fichref;
$file = $dir . "/" . $fichref . ".pdf"; $file = $dir . "/" . $fichref . ".pdf";
if (! file_exists($dir)) if (! file_exists($dir))

View File

@ -331,7 +331,7 @@ class ImportCsv extends ModeleImports
// Make some tests // Make some tests
// Required field is ok // 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]['lib']=$langs->trans('ErrorMissingMandatoryValue',$key);
$this->errors[$error]['type']='NOTNULL'; $this->errors[$error]['type']='NOTNULL';
@ -340,7 +340,7 @@ class ImportCsv extends ModeleImports
} }
// Test format only if field is not a missing mandatory field // Test format only if field is not a missing mandatory field
else { 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]['lib']=$langs->trans('ErrorWrongValueForField',$key,$newval,$objimport->array_import_regex[0][$val]);
$this->errors[$error]['type']='REGEX'; $this->errors[$error]['type']='REGEX';

View File

@ -66,7 +66,7 @@ class ModeleImports
$i=0; $i=0;
while (($file = readdir($handle))!==false) while (($file = readdir($handle))!==false)
{ {
if (eregi("^import_(.*)\.modules\.php",$file,$reg)) if (preg_match("/^import_(.*)\.modules\.php/i",$file,$reg))
{ {
$moduleid=$reg[1]; $moduleid=$reg[1];

View File

@ -82,7 +82,7 @@ class mod_livraison_jade extends ModeleNumRefDeliveryOrder
} }
// Si au moins un champ respectant le modele a ete trouvee // 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 // Recherche rapide car restreint par un like sur champ indexe
$posindice=5; $posindice=5;

View File

@ -123,7 +123,7 @@ class pdf_sirocco extends ModelePDFDeliveryOrder
$objectref = dol_sanitizeFileName($object->ref); $objectref = dol_sanitizeFileName($object->ref);
$dir = $conf->expedition->dir_output."/receipt"; $dir = $conf->expedition->dir_output."/receipt";
if (! eregi('specimen',$objectref)) $dir.= "/" . $objectref; if (! preg_match('/specimen/i',$objectref)) $dir.= "/" . $objectref;
$file = $dir . "/" . $objectref . ".pdf"; $file = $dir . "/" . $objectref . ".pdf";
if (! file_exists($dir)) if (! file_exists($dir))

View File

@ -144,7 +144,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder
$objectref = dol_sanitizeFileName($object->ref); $objectref = dol_sanitizeFileName($object->ref);
$dir = $conf->expedition->dir_output."/receipt"; $dir = $conf->expedition->dir_output."/receipt";
if (! eregi('specimen',$objectref)) $dir.= "/" . $objectref; if (! preg_match('/specimen/i',$objectref)) $dir.= "/" . $objectref;
$file = $dir . "/" . $objectref . ".pdf"; $file = $dir . "/" . $objectref . ".pdf";
if (! file_exists($dir)) if (! file_exists($dir))

View File

@ -103,7 +103,7 @@ class modExternalRss extends DolibarrModules
{ {
while ($obj = $this->db->fetch_object($result)) 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 // Definie la boite si on a trouvee une ancienne configuration
$this->boxes[$reg[1]][0] = "(ExternalRSSInformations)"; $this->boxes[$reg[1]][0] = "(ExternalRSSInformations)";

View File

@ -79,7 +79,7 @@ class mod_propale_marbre extends ModeleNumRefPropales
$row = $db->fetch_row($resql); $row = $db->fetch_row($resql);
if ($row) $pryymm = substr($row[0],0,6); 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; return true;
} }

View File

@ -597,7 +597,7 @@ class pdf_propale_azur extends ModelePDFPropales
$pdf->SetXY ($col1x, $tab2_top + $tab2_hl * $index); $pdf->SetXY ($col1x, $tab2_top + $tab2_hl * $index);
$tvacompl=''; $tvacompl='';
if (eregi('\*',$tvakey)) if (preg_match('/\*/',$tvakey))
{ {
$tvakey=str_replace('*','',$tvakey); $tvakey=str_replace('*','',$tvakey);
$tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")"; $tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")";

View File

@ -187,10 +187,10 @@ class mod_codeclient_elephant extends ModeleThirdPartyCode
global $conf; global $conf;
$mask = $conf->global->COMPANY_ELEPHANT_MASK_CUSTOMER; $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; $mask = $conf->global->COMPANY_ELEPHANT_MASK_SUPPLIER;
if (eregi('\{pre\}',$mask)) return 1; if (preg_match('/\{pre\}/i',$mask)) return 1;
return 0; return 0;
} }

View File

@ -76,7 +76,7 @@ class mod_commande_fournisseur_muguet extends ModeleNumRefSuppliersOrders
$row = $db->fetch_row($resql); $row = $db->fetch_row($resql);
if ($row) $coyymm = substr($row[0],0,6); 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; return true;
} }

View File

@ -451,7 +451,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
$tvacompl=''; $tvacompl='';
if (eregi('\*',$tvakey)) if (preg_match('/\*/',$tvakey))
{ {
$tvakey=str_replace('*','',$tvakey); $tvakey=str_replace('*','',$tvakey);
$tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")"; $tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")";

View File

@ -316,7 +316,7 @@ class nusoap_server extends nusoap_base {
// get the character encoding of the incoming request // get the character encoding of the incoming request
if(isset($this->headers['content-type']) && strpos($this->headers['content-type'],'=')){ if(isset($this->headers['content-type']) && strpos($this->headers['content-type'],'=')){
$enc = str_replace('"','',substr(strstr($this->headers["content-type"],'='),1)); $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); $this->xml_encoding = strtoupper($enc);
} else { } else {
$this->xml_encoding = 'US-ASCII'; $this->xml_encoding = 'US-ASCII';
@ -345,7 +345,7 @@ class nusoap_server extends nusoap_base {
$enc = substr(strstr($v, '='), 1); $enc = substr(strstr($v, '='), 1);
$enc = str_replace('"', '', $enc); $enc = str_replace('"', '', $enc);
$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); $this->xml_encoding = strtoupper($enc);
} else { } else {
$this->xml_encoding = 'US-ASCII'; $this->xml_encoding = 'US-ASCII';
@ -379,7 +379,7 @@ class nusoap_server extends nusoap_base {
$enc = substr(strstr($v, '='), 1); $enc = substr(strstr($v, '='), 1);
$enc = str_replace('"', '', $enc); $enc = str_replace('"', '', $enc);
$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); $this->xml_encoding = strtoupper($enc);
} else { } else {
$this->xml_encoding = 'US-ASCII'; $this->xml_encoding = 'US-ASCII';
@ -805,7 +805,7 @@ class nusoap_server extends nusoap_base {
if (strpos($headers['content-type'], '=')) { if (strpos($headers['content-type'], '=')) {
$enc = str_replace('"', '', substr(strstr($headers["content-type"], '='), 1)); $enc = str_replace('"', '', substr(strstr($headers["content-type"], '='), 1));
$this->debug('Got response encoding: ' . $enc); $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); $this->xml_encoding = strtoupper($enc);
} else { } else {
$this->xml_encoding = 'US-ASCII'; $this->xml_encoding = 'US-ASCII';

View File

@ -490,7 +490,7 @@ class nusoap_client extends nusoap_base {
if (strpos($headers['content-type'], '=')) { if (strpos($headers['content-type'], '=')) {
$enc = str_replace('"', '', substr(strstr($headers["content-type"], '='), 1)); $enc = str_replace('"', '', substr(strstr($headers["content-type"], '='), 1));
$this->debug('Got response encoding: ' . $enc); $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); $this->xml_encoding = strtoupper($enc);
} else { } else {
$this->xml_encoding = 'US-ASCII'; $this->xml_encoding = 'US-ASCII';

View File

@ -3725,7 +3725,7 @@ class nusoap_server extends nusoap_base {
// get the character encoding of the incoming request // get the character encoding of the incoming request
if(isset($this->headers['content-type']) && strpos($this->headers['content-type'],'=')){ if(isset($this->headers['content-type']) && strpos($this->headers['content-type'],'=')){
$enc = str_replace('"','',substr(strstr($this->headers["content-type"],'='),1)); $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); $this->xml_encoding = strtoupper($enc);
} else { } else {
$this->xml_encoding = 'US-ASCII'; $this->xml_encoding = 'US-ASCII';
@ -3754,7 +3754,7 @@ class nusoap_server extends nusoap_base {
$enc = substr(strstr($v, '='), 1); $enc = substr(strstr($v, '='), 1);
$enc = str_replace('"', '', $enc); $enc = str_replace('"', '', $enc);
$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); $this->xml_encoding = strtoupper($enc);
} else { } else {
$this->xml_encoding = 'US-ASCII'; $this->xml_encoding = 'US-ASCII';
@ -3788,7 +3788,7 @@ class nusoap_server extends nusoap_base {
$enc = substr(strstr($v, '='), 1); $enc = substr(strstr($v, '='), 1);
$enc = str_replace('"', '', $enc); $enc = str_replace('"', '', $enc);
$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); $this->xml_encoding = strtoupper($enc);
} else { } else {
$this->xml_encoding = 'US-ASCII'; $this->xml_encoding = 'US-ASCII';
@ -4214,7 +4214,7 @@ class nusoap_server extends nusoap_base {
if (strpos($headers['content-type'], '=')) { if (strpos($headers['content-type'], '=')) {
$enc = str_replace('"', '', substr(strstr($headers["content-type"], '='), 1)); $enc = str_replace('"', '', substr(strstr($headers["content-type"], '='), 1));
$this->debug('Got response encoding: ' . $enc); $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); $this->xml_encoding = strtoupper($enc);
} else { } else {
$this->xml_encoding = 'US-ASCII'; $this->xml_encoding = 'US-ASCII';
@ -7506,7 +7506,7 @@ class nusoap_client extends nusoap_base {
if (strpos($headers['content-type'], '=')) { if (strpos($headers['content-type'], '=')) {
$enc = str_replace('"', '', substr(strstr($headers["content-type"], '='), 1)); $enc = str_replace('"', '', substr(strstr($headers["content-type"], '='), 1));
$this->debug('Got response encoding: ' . $enc); $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); $this->xml_encoding = strtoupper($enc);
} else { } else {
$this->xml_encoding = 'US-ASCII'; $this->xml_encoding = 'US-ASCII';

View File

@ -1436,7 +1436,7 @@ function _fact()
$this->_advance(); $this->_advance();
return $result; 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 // if it's a function call
$result = $this->_func(); $result = $this->_func();