2
0
forked from Wavyzz/dolibarr

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
@@ -198,7 +198,7 @@ if ($_GET["id"] > 0 && ! eregi('^add',$_GET["action"]))
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).'">';
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 '<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
//$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');
//$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
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;

View File

@@ -279,7 +279,7 @@ if ($_GET["id"] || $_GET["ref"])
print '<br>';
// 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>';
}

View File

@@ -532,7 +532,7 @@ if ($_GET["action"] == 'create')
print '<br>';
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]);
}

View File

@@ -427,7 +427,7 @@ if (! is_array($theme_datacolor)) $theme_datacolor=array(array(120,130,150), arr
// Add link to show birthdays
$link='<a href="'.$_SERVER['PHP_SELF'];
$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'];
$link.='?'.$newparam;
$link.='">';

View File

@@ -239,7 +239,7 @@ if ($mil->fetch($_REQUEST["id"]) >= 0)
{
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];
if ($modulename == 'example') continue;

View File

@@ -120,7 +120,7 @@ if ($_POST["action"] == 'sendallconfirmed' && $_POST['confirm'] == 'yes')
$errorsto = $mil->email_errorsto;
// Le message est-il en html
$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
// 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
$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
$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 (eregi("(.*)\.(.*)\.(.*)",$file,$reg))
if (preg_match("/(.*)\.(.*)\.(.*)/i",$file,$reg))
{
$modulename=$reg[1];
if ($modulename == 'example') continue;

View File

@@ -240,7 +240,7 @@ class Commande extends CommonObject
$result=$soc->set_as_client();
// 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);
}
@@ -291,7 +291,7 @@ class Commande extends CommonObject
if (! $error)
{
// 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)
// afin de ne pas perdre les fichiers attaches

View File

@@ -831,7 +831,7 @@ class Account extends CommonObject
if (! empty($this->iban))
{
// 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

View File

@@ -510,7 +510,7 @@ if ($account || $_GET["ref"])
//if ($isbanktransfert || $issocialcontrib) $showlabel=true;
if ($showlabel)
{
if (eregi('^\((.*)\)$',$objp->label,$reg))
if (preg_match('/^\((.*)\)$/i',$objp->label,$reg))
{
// Genereic description because between (). We show it after translating.
print $langs->trans($reg[1]);
@@ -565,9 +565,9 @@ if ($account || $_GET["ref"])
else {
//print ' - ';
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<EFBFBD>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]);
}
@@ -592,7 +592,7 @@ if ($account || $_GET["ref"])
}
/*else if ($links[$key]['type']=='sc') {
$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';
$chargestatic->lib=$langs->trans($reg[1]);

View File

@@ -57,7 +57,7 @@ $form = new Form($db);
// Get account informations
$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"]);
}
@@ -140,7 +140,7 @@ print '<tr><td valign="top" width="25%">'.$langs->trans("Ref").'</td>';
print '<td colspan="3">';
if ($_GET["account"])
{
if (! eregi(',',$_GET["account"]))
if (! preg_match('/,/',$_GET["account"]))
{
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);
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"]);
}
@@ -739,7 +739,7 @@ print '<tr><td valign="top" width="25%">'.$langs->trans("Ref").'</td>';
print '<td colspan="3">';
if ($account)
{
if (! eregi(',',$account))
if (! preg_match('/,/',$account))
{
$moreparam='&month='.$month.'&year='.$year.($mode=='showalltime'?'&mode=showalltime':'');
if ($_GET["option"]!='all')

View File

@@ -312,7 +312,7 @@ if ($result)
{
print '<td colspan="3">';
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
print $langs->trans($reg[1]);
@@ -328,7 +328,7 @@ if ($result)
else
{
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
print $langs->trans($reg[1]);

View File

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

View File

@@ -300,7 +300,7 @@ else
// Libelle
print '<td valign="center"><a href="'.DOL_URL_ROOT.'/compta/bank/ligne.php?rowid='.$objp->rowid.'&amp;account='.$acct->id.'">';
$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 '</a>';

View File

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

View File

@@ -127,7 +127,7 @@ print '<br>';
clearstatcache();
// Affiche lien sur autres ann<EFBFBD>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;

View File

@@ -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;

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)
$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.'<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]);
$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<br>\n";

View File

@@ -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].='&amp;idmenu='.$menu['rowid'];
if (preg_match('/\?/',$tabMenu[$b][2])) $tabMenu[$b][2].='&amp;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]);

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">';
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 '</td></tr>';
// Actions buttons
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)
{

View File

@@ -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];

View File

@@ -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);

View File

@@ -484,7 +484,7 @@ class PaiementFourn
$lienfin='</a>';
$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';

View File

@@ -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);
}

View File

@@ -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 '<td nowrap="nowrap" style="font-weight: normal">=>'.img_object('',$entityicon).' '.$langs->trans($entitylang).'</td>';
print '<td style="font-weight: normal">';
$newlabel=preg_replace('/\*$/i','',$label);
$newlabel=preg_replace('/\*$/','',$label);
$text=$langs->trans($newlabel);
$more='';
if (eregi('\*$',$label))
if (preg_match('/\*$/',$label))
{
$text='<b>'.$text.'*</b>';
$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("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];
if ($note) $htmltext.='<br>'.$langs->trans("Note").'/'.$langs->trans("Example").': '.$note;
$text.=$more;

View File

@@ -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);

View File

@@ -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;
}

View File

@@ -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'].'<br>';
$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'].'<br>';
$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.'<br>';
}
}
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.'<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.
$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;
}

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.
$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;
}

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);
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 (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&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 (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&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/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&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 (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&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/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&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/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/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&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/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/liste.php?leftmenu=members_checks",$langs->trans("MenuChequesReceipts"),1,$user->rights->adherent->cotisation->lire);
}
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);
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 (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&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 (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&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/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&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 (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&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/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&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/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/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&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/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/liste.php?leftmenu=members_checks",$langs->trans("MenuChequesReceipts"),1,$user->rights->adherent->cotisation->lire);
}
if ($conf->banque->enabled)

View File

@@ -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=&';
}

View File

@@ -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=&';
}

View File

@@ -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=&';
}

View File

@@ -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=&';
}

View File

@@ -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'];

View File

@@ -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'];

View File

@@ -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);
}

View File

@@ -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;

View File

@@ -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").")";

View File

@@ -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]);
}

View File

@@ -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]).'<br>';
$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]).'<br>';

View File

@@ -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]);
}

View File

@@ -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];

View File

@@ -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").")";

View File

@@ -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").")";

View File

@@ -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;

View File

@@ -21,7 +21,7 @@
/**
\file htdocs/includes/modules/fichinter/mod_pacific.php
\ingroup fiche intervention
\brief Fichier contenant la classe du mod<EFBFBD>le de num<EFBFBD>rotation de r<EFBFBD>f<EFBFBD>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<EFBFBD>le de num<75>rotation de r<EFBFBD>f<EFBFBD>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<EFBFBD>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<EFBFBD>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<EFBFBD>ros d<EFBFBD>j<EFBFBD> en vigueur dans la base ne provoquent pas de
* de conflits qui empechera cette num<EFBFBD>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<EFBFBD>e
* \param objsoc Objet soci<EFBFBD>t<EFBFBD>
/** \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<EFBFBD>cup<EFBFBD>re la valeur max (r<EFBFBD>ponse imm<EFBFBD>diate car champ ind<EFBFBD>x<EFBFBD>)
// D'abord on recupere la valeur max (reponse immediate car champ indexe)
$posindice=8;
$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);
$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))

View File

@@ -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';

View File

@@ -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];

View File

@@ -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;

View File

@@ -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))

View File

@@ -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))

View File

@@ -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)";

View File

@@ -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;
}

View File

@@ -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").")";

View File

@@ -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;
}

View File

@@ -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;
}

View File

@@ -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").")";

View File

@@ -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';

View File

@@ -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';

View File

@@ -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';

View File

@@ -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();