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

This commit is contained in:
Regis Houssin 2009-10-23 19:03:01 +00:00
parent ced0248111
commit a33a015eb4
26 changed files with 70 additions and 70 deletions

View File

@ -68,7 +68,7 @@ print '<li>';
print '<a target="blank" href="http://www.dolibarr.org/">'.$langs->trans("OfficialWebSite").'</a>'; print '<a target="blank" href="http://www.dolibarr.org/">'.$langs->trans("OfficialWebSite").'</a>';
print '</li>'; print '</li>';
// Si langue francaise, on affiche site web francophone // Si langue francaise, on affiche site web francophone
if (eregi('^fr_',$langs->getDefaultLang())) if (preg_match('/^fr_/i',$langs->getDefaultLang()))
{ {
print '<li>'; print '<li>';
print '<a target="blank" href="http://www.dolibarr.fr/">'.$langs->trans("OfficialWebSiteFr").'</a>'; print '<a target="blank" href="http://www.dolibarr.fr/">'.$langs->trans("OfficialWebSiteFr").'</a>';
@ -81,7 +81,7 @@ print '<li>';
print '<a target="blank" href="http://demo.dolibarr.org/public/demo">'.$langs->trans("OfficialDemo").'</a>'; print '<a target="blank" href="http://demo.dolibarr.org/public/demo">'.$langs->trans("OfficialDemo").'</a>';
print '</li>'; print '</li>';
if (eregi('^fr_',$langs->getDefaultLang())) if (preg_match('/^fr_/i',$langs->getDefaultLang()))
{ {
print '<li>'; print '<li>';
print 'Les t&acirc;ches en cours de r&eacute;alisation sur Dolibarr sont consultables dans le <a target="blank" href="http://savannah.nongnu.org/task/?group=dolibarr">gestionnaire de projets</a> sur Savannah.'; print 'Les t&acirc;ches en cours de r&eacute;alisation sur Dolibarr sont consultables dans le <a target="blank" href="http://savannah.nongnu.org/task/?group=dolibarr">gestionnaire de projets</a> sur Savannah.';

View File

@ -701,7 +701,7 @@ class ActionComm
$event['transparency']='TRANSPARENT'; // TRANSPARENT or OPAQUE $event['transparency']='TRANSPARENT'; // TRANSPARENT or OPAQUE
$event['category']=$langs->convToOutputCharset($obj->libelle); // libelle type action $event['category']=$langs->convToOutputCharset($obj->libelle); // libelle type action
$url=$dolibarr_main_url_root; $url=$dolibarr_main_url_root;
if (! eregi('\/$',$url)) $url.='/'; if (! preg_match('/\/$/',$url)) $url.='/';
$url.='comm/action/fiche.php?id='.$obj->id; $url.='comm/action/fiche.php?id='.$obj->id;
$event['url']=$url; $event['url']=$url;

View File

@ -217,7 +217,7 @@ class CompanyBankAccount
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-z]{2}/i)",$this->iban,$reg)) return $reg[1];
} }
// We return country code // We return country code

View File

@ -318,7 +318,7 @@ class Contact extends CommonObject
if ($this->birthday) // <0 si avant 1970, >0 si apres 1970 if ($this->birthday) // <0 si avant 1970, >0 si apres 1970
{ {
if (eregi('^[0-9]+\-',$this->birthday)) if (preg_match('/^[0-9]+\-/',$this->birthday))
{ {
// Si date = chaine (ne devrait pas arriver) // Si date = chaine (ne devrait pas arriver)
$sql .= ", birthday='".$this->birthday."'"; $sql .= ", birthday='".$this->birthday."'";

View File

@ -154,14 +154,14 @@ function pdf_pagefoot(&$pdf,$outputlangs,$paramfreetext,$fromcompany,$marge_bass
if ($fromcompany->profid1 && ($fromcompany->pays_code != 'FR' || ! $fromcompany->profid2)) if ($fromcompany->profid1 && ($fromcompany->pays_code != 'FR' || ! $fromcompany->profid2))
{ {
$field=$outputlangs->transcountrynoentities("ProfId1",$fromcompany->pays_code); $field=$outputlangs->transcountrynoentities("ProfId1",$fromcompany->pays_code);
if (eregi('\((.*)\)',$field,$reg)) $field=$reg[1]; if (preg_match('/\((.*)\)/i',$field,$reg)) $field=$reg[1];
$ligne1.=($ligne1?" - ":"").$field.": ".$outputlangs->convToOutputCharset($fromcompany->profid1); $ligne1.=($ligne1?" - ":"").$field.": ".$outputlangs->convToOutputCharset($fromcompany->profid1);
} }
// Prof Id 2 // Prof Id 2
if ($fromcompany->profid2) if ($fromcompany->profid2)
{ {
$field=$outputlangs->transcountrynoentities("ProfId2",$fromcompany->pays_code); $field=$outputlangs->transcountrynoentities("ProfId2",$fromcompany->pays_code);
if (eregi('\((.*)\)',$field,$reg)) $field=$reg[1]; if (preg_match('/\((.*)\)/i',$field,$reg)) $field=$reg[1];
$ligne1.=($ligne1?" - ":"").$field.": ".$outputlangs->convToOutputCharset($fromcompany->profid2); $ligne1.=($ligne1?" - ":"").$field.": ".$outputlangs->convToOutputCharset($fromcompany->profid2);
} }
@ -171,14 +171,14 @@ function pdf_pagefoot(&$pdf,$outputlangs,$paramfreetext,$fromcompany,$marge_bass
if ($fromcompany->profid3) if ($fromcompany->profid3)
{ {
$field=$outputlangs->transcountrynoentities("ProfId3",$fromcompany->pays_code); $field=$outputlangs->transcountrynoentities("ProfId3",$fromcompany->pays_code);
if (eregi('\((.*)\)',$field,$reg)) $field=$reg[1]; if (preg_match('/\((.*)\)/i',$field,$reg)) $field=$reg[1];
$ligne2.=($ligne2?" - ":"").$field.": ".$outputlangs->convToOutputCharset($fromcompany->profid3); $ligne2.=($ligne2?" - ":"").$field.": ".$outputlangs->convToOutputCharset($fromcompany->profid3);
} }
// Prof Id 4 // Prof Id 4
if ($fromcompany->profid4) if ($fromcompany->profid4)
{ {
$field=$outputlangs->transcountrynoentities("ProfId4",$fromcompany->pays_code); $field=$outputlangs->transcountrynoentities("ProfId4",$fromcompany->pays_code);
if (eregi('\((.*)\)',$field,$reg)) $field=$reg[1]; if (preg_match('/\((.*)\)/i',$field,$reg)) $field=$reg[1];
$ligne2.=($ligne2?" - ":"").$field.": ".$outputlangs->convToOutputCharset($fromcompany->profid4); $ligne2.=($ligne2?" - ":"").$field.": ".$outputlangs->convToOutputCharset($fromcompany->profid4);
} }
// IntraCommunautary VAT // IntraCommunautary VAT

View File

@ -387,7 +387,7 @@ function encodedecode_dbpassconf($level=0)
$val = trim($reg[1]); // This also remove CR/LF $val = trim($reg[1]); // This also remove CR/LF
$val=preg_replace('/^["\']/','',$val); $val=preg_replace('/^["\']/','',$val);
$val=preg_replace('/["\'][\s;]*$/','',$val); $val=preg_replace('/["\'][\s;]*$/','',$val);
if (eregi('crypted:',$buffer)) if (preg_match('/crypted:/i',$buffer))
{ {
$val = preg_replace('/crypted:/i','',$val); $val = preg_replace('/crypted:/i','',$val);
$passwd_crypted = $val; $passwd_crypted = $val;

View File

@ -61,7 +61,7 @@ function is_in_subtree($fulltree,$parentid,$childid)
if ($record['id'] == $childid) if ($record['id'] == $childid)
{ {
//print $record['fullpath'].'_'.' - '.$fullpathparent.'_'; //print $record['fullpath'].'_'.' - '.$fullpathparent.'_';
if (eregi($fullpathparent.'_',$record['fullpath'].'_')) if (preg_match('/'.$fullpathparent.'_/i',$record['fullpath'].'_'))
{ {
//print 'DEL='.$childid; //print 'DEL='.$childid;
return 1; return 1;
@ -150,7 +150,7 @@ function tree_addjs()
} }
/* cette fonction gère le décallage des éléments /* cette fonction g<EFBFBD>re le d<EFBFBD>callage des <EFBFBD>l<EFBFBD>ments
suivant leur position dans l'arborescence suivant leur position dans l'arborescence
*/ */
function tree_showline($tab,$rang) function tree_showline($tab,$rang)
@ -219,10 +219,10 @@ function tree_showline($tab,$rang)
} }
/*fonction récursive d'affichage de l'arbre /*fonction r<EFBFBD>cursive d'affichage de l'arbre
$tab :tableau des éléments $tab :tableau des <EFBFBD>l<EFBFBD>ments
$pere :index de l'élément courant $pere :index de l'<EFBFBD>l<EFBFBD>ment courant
$rang :décallage de l'élément $rang :d<EFBFBD>callage de l'<EFBFBD>l<EFBFBD>ment
*/ */
function tree_recur($tab,$pere,$rang) function tree_recur($tab,$pere,$rang)
{ {
@ -233,15 +233,15 @@ function tree_recur($tab,$pere,$rang)
//ballayage du tableau //ballayage du tableau
for ($x=0;$x<count($tab);$x++) for ($x=0;$x<count($tab);$x++)
{ {
//si un élément a pour père : $pere //si un <EFBFBD>l<EFBFBD>ment a pour p<>re : $pere
if ($tab[$x][1]==$pere) if ($tab[$x][1]==$pere)
{ {
//on l'affiche avec le décallage courrant //on l'affiche avec le d<EFBFBD>callage courrant
tree_showline($tab[$x],$rang); tree_showline($tab[$x],$rang);
/*et on recherche ses fils /*et on recherche ses fils
en rappelant la fonction recur() en rappelant la fonction recur()
(+ incrémentation du décallage)*/ (+ incr<EFBFBD>mentation du d<EFBFBD>callage)*/
tree_recur($tab,$tab[$x][0],$rang+1); tree_recur($tab,$tab[$x][0],$rang+1);
} }
} }

View File

@ -162,7 +162,7 @@ function show_theme($fuser,$edit=0,$foruserprofile=false)
while (($subdir = readdir($handle))!==false) while (($subdir = readdir($handle))!==false)
{ {
if (is_dir($dirtheme."/".$subdir) && substr($subdir, 0, 1) <> '.' if (is_dir($dirtheme."/".$subdir) && substr($subdir, 0, 1) <> '.'
&& substr($subdir, 0, 3) <> 'CVS' && ! eregi('common',$subdir)) && substr($subdir, 0, 3) <> 'CVS' && ! preg_match('/common/i',$subdir))
{ {
if ($i % $thumbsbyrow == 0) if ($i % $thumbsbyrow == 0)
{ {

View File

@ -260,7 +260,7 @@ function build_rssfile($format='rss',$title,$desc,$events_array,$outputfile,$fil
'<generator>Dolibarr</generator>'."\n"; '<generator>Dolibarr</generator>'."\n";
$url=$dolibarr_main_url_root; $url=$dolibarr_main_url_root;
if (! eregi('\/$',$url)) $url.='/'; if (! preg_match('/\/$/',$url)) $url.='/';
$url.='comm/action/agendaexport.php?format=rss&exportkey='.urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY); $url.='comm/action/agendaexport.php?format=rss&exportkey='.urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY);
$html.='<link><![CDATA['.$url.']]></link>'."\n"; $html.='<link><![CDATA['.$url.']]></link>'."\n";
// '<managingEditor>editor@example.com</managingEditor>'."\n" // '<managingEditor>editor@example.com</managingEditor>'."\n"

View File

@ -561,7 +561,7 @@ else
{ {
print '<div class="tabsAction">'; print '<div class="tabsAction">';
// if (! eregi('^(valid|delete)',$_REQUEST["action"])) // if (! preg_match('/^(valid|delete)/i',$_REQUEST["action"]))
// { // {
if ($livraison->statut == 0 && $user->rights->expedition->livraison->valider && $num_prod > 0) if ($livraison->statut == 0 && $user->rights->expedition->livraison->valider && $num_prod > 0)
{ {

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

@ -126,12 +126,12 @@ function print_paybox_redirect($PRICE,$CURRENCY,$EMAIL,$urlok,$urlko,$TAG)
$IBS_BKGD="#FFFFFF"; $IBS_BKGD="#FFFFFF";
$IBS_WAIT="2000"; $IBS_WAIT="2000";
$IBS_LANG="GBR"; // By default GBR=english (FRA, GBR, ESP, ITA et DEU...) $IBS_LANG="GBR"; // By default GBR=english (FRA, GBR, ESP, ITA et DEU...)
if (eregi('^FR',$langs->defaultlang)) $IBS_LANG="FRA"; if (preg_match('/^FR/i',$langs->defaultlang)) $IBS_LANG="FRA";
if (eregi('^ES',$langs->defaultlang)) $IBS_LANG="ESP"; if (preg_match('/^ES/i',$langs->defaultlang)) $IBS_LANG="ESP";
if (eregi('^IT',$langs->defaultlang)) $IBS_LANG="ITA"; if (preg_match('/^IT/i',$langs->defaultlang)) $IBS_LANG="ITA";
if (eregi('^DE',$langs->defaultlang)) $IBS_LANG="DEU"; if (preg_match('/^DE/i',$langs->defaultlang)) $IBS_LANG="DEU";
if (eregi('^NL',$langs->defaultlang)) $IBS_LANG="NLD"; if (preg_match('/^NL/i',$langs->defaultlang)) $IBS_LANG="NLD";
if (eregi('^SE',$langs->defaultlang)) $IBS_LANG="SWE"; if (preg_match('/^SE/i',$langs->defaultlang)) $IBS_LANG="SWE";
$IBS_OUTPUT='E'; $IBS_OUTPUT='E';
$PBX_SOURCE='HTML'; $PBX_SOURCE='HTML';
$PBX_TYPEPAIEMENT='CARTE'; $PBX_TYPEPAIEMENT='CARTE';
@ -253,14 +253,14 @@ function html_print_footer($fromcompany,$langs)
if ($fromcompany->profid1 && ($fromcompany->pays_code != 'FR' || ! $fromcompany->profid2)) if ($fromcompany->profid1 && ($fromcompany->pays_code != 'FR' || ! $fromcompany->profid2))
{ {
$field=$langs->transcountrynoentities("ProfId1",$fromcompany->pays_code); $field=$langs->transcountrynoentities("ProfId1",$fromcompany->pays_code);
if (eregi('\((.*)\)',$field,$reg)) $field=$reg[1]; if (preg_match('/\((.*)\)/i',$field,$reg)) $field=$reg[1];
$ligne1.=($ligne1?" - ":"").$field.": ".$langs->convToOutputCharset($fromcompany->profid1); $ligne1.=($ligne1?" - ":"").$field.": ".$langs->convToOutputCharset($fromcompany->profid1);
} }
// Prof Id 2 // Prof Id 2
if ($fromcompany->profid2) if ($fromcompany->profid2)
{ {
$field=$langs->transcountrynoentities("ProfId2",$fromcompany->pays_code); $field=$langs->transcountrynoentities("ProfId2",$fromcompany->pays_code);
if (eregi('\((.*)\)',$field,$reg)) $field=$reg[1]; if (preg_match('/\((.*)\)/i',$field,$reg)) $field=$reg[1];
$ligne1.=($ligne1?" - ":"").$field.": ".$langs->convToOutputCharset($fromcompany->profid2); $ligne1.=($ligne1?" - ":"").$field.": ".$langs->convToOutputCharset($fromcompany->profid2);
} }
@ -270,14 +270,14 @@ function html_print_footer($fromcompany,$langs)
if ($fromcompany->profid3) if ($fromcompany->profid3)
{ {
$field=$langs->transcountrynoentities("ProfId3",$fromcompany->pays_code); $field=$langs->transcountrynoentities("ProfId3",$fromcompany->pays_code);
if (eregi('\((.*)\)',$field,$reg)) $field=$reg[1]; if (preg_match('/\((.*)\)/i',$field,$reg)) $field=$reg[1];
$ligne2.=($ligne2?" - ":"").$field.": ".$langs->convToOutputCharset($fromcompany->profid3); $ligne2.=($ligne2?" - ":"").$field.": ".$langs->convToOutputCharset($fromcompany->profid3);
} }
// Prof Id 4 // Prof Id 4
if ($fromcompany->profid4) if ($fromcompany->profid4)
{ {
$field=$langs->transcountrynoentities("ProfId4",$fromcompany->pays_code); $field=$langs->transcountrynoentities("ProfId4",$fromcompany->pays_code);
if (eregi('\((.*)\)',$field,$reg)) $field=$reg[1]; if (preg_match('/\((.*)\)/i',$field,$reg)) $field=$reg[1];
$ligne2.=($ligne2?" - ":"").$field.": ".$langs->convToOutputCharset($fromcompany->profid4); $ligne2.=($ligne2?" - ":"").$field.": ".$langs->convToOutputCharset($fromcompany->profid4);
} }
// IntraCommunautary VAT // IntraCommunautary VAT

View File

@ -346,10 +346,10 @@ if ($resql)
if ($conf->service->enabled && $type != 0) if ($conf->service->enabled && $type != 0)
{ {
print '<td align="center">'; print '<td align="center">';
if (eregi('([0-9]+)y',$objp->duration,$regs)) print $regs[1].' '.$langs->trans("DurationYear"); if (preg_match('/([0-9]+)y/i',$objp->duration,$regs)) print $regs[1].' '.$langs->trans("DurationYear");
elseif (eregi('([0-9]+)m',$objp->duration,$regs)) print $regs[1].' '.$langs->trans("DurationMonth"); elseif (preg_match('/([0-9]+)m/i',$objp->duration,$regs)) print $regs[1].' '.$langs->trans("DurationMonth");
elseif (eregi('([0-9]+)w',$objp->duration,$regs)) print $regs[1].' '.$langs->trans("DurationWeek"); elseif (preg_match('/([0-9]+)w/i',$objp->duration,$regs)) print $regs[1].' '.$langs->trans("DurationWeek");
elseif (eregi('([0-9]+)d',$objp->duration,$regs)) print $regs[1].' '.$langs->trans("DurationDay"); elseif (preg_match('/([0-9]+)d/i',$objp->duration,$regs)) print $regs[1].' '.$langs->trans("DurationDay");
else print $objp->duration; else print $objp->duration;
print '</td>'; print '</td>';
} }

View File

@ -231,7 +231,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']) && ($product->imgWidth > $maxWidth || $product->imgHeight > $maxHeight)) if (!$obj['photo_vignette'] && preg_match('/(\.bmp|\.gif|\.jpg|\.jpeg|\.png)$/i',$obj['photo']) && ($product->imgWidth > $maxWidth || $product->imgHeight > $maxHeight))
{ {
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$_GET["id"].'&amp;action=addthumb&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;file='.urlencode($pdir.$viewfilename).'">'.img_refresh($langs->trans('GenerateThumb')).'&nbsp;&nbsp;</a>';
} }

View File

@ -70,7 +70,7 @@ if ($_POST["action"] == 'update_price' && ! $_POST["cancel"] && ($user->rights->
$newprice=price2num($_POST["price_".$i],'MU'); $newprice=price2num($_POST["price_".$i],'MU');
$newprice_min=price2num($_POST["price_min_".$i],'MU'); $newprice_min=price2num($_POST["price_min_".$i],'MU');
$newpricebase=$_POST["multiprices_base_type_".$i]; $newpricebase=$_POST["multiprices_base_type_".$i];
$newnpr=(eregi('\*',$_POST["tva_tx_".$i]) ? 1 : 0); $newnpr=(preg_match('/\*/',$_POST["tva_tx_".$i]) ? 1 : 0);
$newvat=str_replace('*','',$_POST["tva_tx_".$i]); $newvat=str_replace('*','',$_POST["tva_tx_".$i]);
break; // We found submited price break; // We found submited price
} }
@ -82,7 +82,7 @@ if ($_POST["action"] == 'update_price' && ! $_POST["cancel"] && ($user->rights->
$newprice=price2num($_POST["price"],'MU'); $newprice=price2num($_POST["price"],'MU');
$newprice_min=price2num($_POST["price_min"],'MU'); $newprice_min=price2num($_POST["price_min"],'MU');
$newpricebase=$_POST["price_base_type"]; $newpricebase=$_POST["price_base_type"];
$newnpr=(eregi('\*',$_POST["tva_tx"]) ? 1 : 0); $newnpr=(preg_match('/\*/',$_POST["tva_tx"]) ? 1 : 0);
$newvat=str_replace('*','',$_POST["tva_tx"]); $newvat=str_replace('*','',$_POST["tva_tx"]);
} }

View File

@ -258,9 +258,9 @@ if ($resql)
if ($conf->service->enabled && $type == 1) if ($conf->service->enabled && $type == 1)
{ {
print '<td align="center">'; print '<td align="center">';
if (eregi('([0-9]+)y',$objp->duration,$regs)) print $regs[1].' '.$langs->trans("DurationYear"); if (preg_match('/([0-9]+)y/i',$objp->duration,$regs)) print $regs[1].' '.$langs->trans("DurationYear");
elseif (eregi('([0-9]+)m',$objp->duration,$regs)) print $regs[1].' '.$langs->trans("DurationMonth"); elseif (preg_match('/([0-9]+)m/i',$objp->duration,$regs)) print $regs[1].' '.$langs->trans("DurationMonth");
elseif (eregi('([0-9]+)d',$objp->duration,$regs)) print $regs[1].' '.$langs->trans("DurationDay"); elseif (preg_match('/([0-9]+)d/i',$objp->duration,$regs)) print $regs[1].' '.$langs->trans("DurationDay");
else print $objp->duration; else print $objp->duration;
print '</td>'; print '</td>';
} }

View File

@ -236,7 +236,7 @@ if ($resql)
$textprofid[$key]=''; $textprofid[$key]='';
if ($label != "ProfId".$key.$mysoc->pays_code) if ($label != "ProfId".$key.$mysoc->pays_code)
{ // Get only text between () { // Get only text between ()
if (eregi('\((.*)\)',$label,$reg)) $label=$reg[1]; if (preg_match('/\((.*)\)/i',$label,$reg)) $label=$reg[1];
$textprofid[$key]=$langs->trans("ProfIdShortDesc",$key,$mysoc->pays_code,$label); $textprofid[$key]=$langs->trans("ProfIdShortDesc",$key,$mysoc->pays_code,$label);
} }
} }

View File

@ -78,23 +78,23 @@ else
print '<b>'.$langs->trans("Response").'</b>:<br>'; print '<b>'.$langs->trans("Response").'</b>:<br>';
// Service indisponible // Service indisponible
if (! is_array($result) || eregi('SERVICE_UNAVAILABLE',$result['faultstring'])) if (! is_array($result) || preg_match('/SERVICE_UNAVAILABLE/i',$result['faultstring']))
{ {
print '<font class="error">'.$langs->trans("ErrorServiceUnavailableTryLater").'</font><br>'; print '<font class="error">'.$langs->trans("ErrorServiceUnavailableTryLater").'</font><br>';
$messagetoshow=$soapclient->response; $messagetoshow=$soapclient->response;
} }
elseif (eregi('TIMEOUT',$result['faultstring'])) elseif (preg_match('/TIMEOUT/i',$result['faultstring']))
{ {
print '<font class="error">'.$langs->trans("ErrorServiceUnavailableTryLater").'</font><br>'; print '<font class="error">'.$langs->trans("ErrorServiceUnavailableTryLater").'</font><br>';
$messagetoshow=$soapclient->response; $messagetoshow=$soapclient->response;
} }
elseif (eregi('SERVER_BUSY',$result['faultstring'])) elseif (preg_match('/SERVER_BUSY/i',$result['faultstring']))
{ {
print '<font class="error">'.$langs->trans("ErrorServiceUnavailableTryLater").'</font><br>'; print '<font class="error">'.$langs->trans("ErrorServiceUnavailableTryLater").'</font><br>';
$messagetoshow=$soapclient->response; $messagetoshow=$soapclient->response;
} }
// Syntaxe ko // Syntaxe ko
elseif (eregi('INVALID_INPUT',$result['faultstring']) elseif (preg_match('/INVALID_INPUT/i',$result['faultstring'])
|| ($result['requestDate'] && ! $result['valid'])) || ($result['requestDate'] && ! $result['valid']))
{ {
if ($result['requestDate']) print $langs->trans("Date").': '.$result['requestDate'].'<br>'; if ($result['requestDate']) print $langs->trans("Date").': '.$result['requestDate'].'<br>';
@ -108,7 +108,7 @@ else
if ($result['requestDate']) print $langs->trans("Date").': '.$result['requestDate'].'<br>'; if ($result['requestDate']) print $langs->trans("Date").': '.$result['requestDate'].'<br>';
print $langs->trans("VATIntraSyntaxIsValid").': <font class="ok">'.$langs->trans("Yes").'</font><br>'; print $langs->trans("VATIntraSyntaxIsValid").': <font class="ok">'.$langs->trans("Yes").'</font><br>';
print $langs->trans("VATIntraValueIsValid").': '; print $langs->trans("VATIntraValueIsValid").': ';
if (eregi('MS_UNAVAILABLE',$result['faultstring'])) if (preg_match('/MS_UNAVAILABLE/i',$result['faultstring']))
{ {
print '<font class="error">'.$langs->trans("ErrorVATCheckMS_UNAVAILABLE",$_REQUEST["countryCode"]).'</font><br>'; print '<font class="error">'.$langs->trans("ErrorVATCheckMS_UNAVAILABLE",$_REQUEST["countryCode"]).'</font><br>';
} }

View File

@ -131,7 +131,7 @@ function stripslashes_deep($value)
{ {
return (is_array($value) ? array_map('stripslashes_deep', $value) : stripslashes($value)); return (is_array($value) ? array_map('stripslashes_deep', $value) : stripslashes($value));
} }
//if (! eregi('PHP/6', $_SERVER['SERVER_SOFTWARE'])) //if (! preg_match('/PHP\/6/i', $_SERVER['SERVER_SOFTWARE']))
if (function_exists('get_magic_quotes_gpc')) // magic_quotes_* plus pris en compte dans PHP6 if (function_exists('get_magic_quotes_gpc')) // magic_quotes_* plus pris en compte dans PHP6
{ {
if (get_magic_quotes_gpc()) if (get_magic_quotes_gpc())

View File

@ -85,12 +85,12 @@ print img_picto_common('','who.png','',1);
print '</td></tr>';*/ print '</td></tr>';*/
print '<tr><td align="center">'; print '<tr><td align="center">';
$urlwiki='http://wiki.dolibarr.org'; $urlwiki='http://wiki.dolibarr.org';
if (eregi('fr',$langs->defaultlang)) $urlwiki='http://wiki.dolibarr.org/index.php/Accueil'; if (preg_match('/fr/i',$langs->defaultlang)) $urlwiki='http://wiki.dolibarr.org/index.php/Accueil';
if (eregi('es',$langs->defaultlang)) $urlwiki='http://wiki.dolibarr.org/index.php/Portada'; if (preg_match('/es/i',$langs->defaultlang)) $urlwiki='http://wiki.dolibarr.org/index.php/Portada';
print '<br>'.$langs->trans("ForDocumentationSeeWiki",$urlwiki,$urlwiki); print '<br>'.$langs->trans("ForDocumentationSeeWiki",$urlwiki,$urlwiki);
print '<br>'; print '<br>';
$urlforum='http://www.dolibarr.org/forum/'; $urlforum='http://www.dolibarr.org/forum/';
if (eregi('fr',$langs->defaultlang)) $urlforum='http://www.dolibarr.fr/forum/'; if (preg_match('/fr/i',$langs->defaultlang)) $urlforum='http://www.dolibarr.fr/forum/';
print '<br>'.$langs->trans("ForAnswersSeeForum",$urlforum,$urlforum).'<br>'; print '<br>'.$langs->trans("ForAnswersSeeForum",$urlforum,$urlforum).'<br>';
print '</td></tr></table>'; print '</td></tr></table>';
print '</td>'; print '</td>';

View File

@ -81,7 +81,7 @@ foreach ($arrayofwidgets as $arraywidget) // Loop on each user
foreach($listoflangs as $langcode) // Loop on each lang of user foreach($listoflangs as $langcode) // Loop on each lang of user
{ {
$pos++; $pos++;
if (eregi($langcode,$langs->defaultlang) || $langcode == 'en') // If lang qualified if (preg_match('/'.$langcode.'/i',$langs->defaultlang) || $langcode == 'en') // If lang qualified
{ {
print '<td align="center">'; print '<td align="center">';
print $arraywidget['name'].'<br>'; print $arraywidget['name'].'<br>';
@ -90,7 +90,7 @@ foreach ($arrayofwidgets as $arraywidget) // Loop on each user
foreach ($listoflangs as $langcode2) foreach ($listoflangs as $langcode2)
{ {
if (empty($widgetid)) $widgetid=$listoflangs[$pos-1]; if (empty($widgetid)) $widgetid=$listoflangs[$pos-1];
if (! eregi($langcode,$langs->defaultlang) && $langcode2 != 'en') continue; // Show only english if (! preg_match('/'.$langcode.'/i',$langs->defaultlang) && $langcode2 != 'en') continue; // Show only english
print $langcode2.' '; print $langcode2.' ';
} }
print '<br>'; print '<br>';

View File

@ -237,7 +237,7 @@ class Webcal {
$event['type']=$type; $event['type']=$type;
$date=$obj->cal_date; $date=$obj->cal_date;
$time=$obj->cal_time; $time=$obj->cal_time;
if (eregi('^([0-9][0-9][0-9][0-9])([0-9][0-9])([0-9][0-9])$',$date,$reg)) if (preg_match('/^([0-9][0-9][0-9][0-9])([0-9][0-9])([0-9][0-9])$/',$date,$reg))
{ {
$year=$reg[1]; $year=$reg[1];
$month=$reg[2]; $month=$reg[2];
@ -246,7 +246,7 @@ class Webcal {
if (! empty($filters['month']) && $year != $filters['month']) $qualified=false; if (! empty($filters['month']) && $year != $filters['month']) $qualified=false;
if (! empty($filters['day']) && $year != $filters['day']) $qualified=false; if (! empty($filters['day']) && $year != $filters['day']) $qualified=false;
} }
if (eregi('^([0-9]?[0-9])([0-9][0-9])([0-9][0-9])$',$time,$reg)) if (preg_match('/^([0-9]?[0-9])([0-9][0-9])([0-9][0-9])$/',$time,$reg))
{ {
$hour=sprintf("%02d",$reg[1]); $hour=sprintf("%02d",$reg[1]);
$min=sprintf("%02d",$reg[2]); $min=sprintf("%02d",$reg[2]);
@ -261,7 +261,7 @@ class Webcal {
$event['author']=$obj->cal_create_by; $event['author']=$obj->cal_create_by;
$event['transparency']='TRANSPARENT'; // TRANSPARENT or OPAQUE $event['transparency']='TRANSPARENT'; // TRANSPARENT or OPAQUE
$url=$conf->global->PHPWEBCALENDAR_URL; $url=$conf->global->PHPWEBCALENDAR_URL;
if (! eregi('\/$',$url)) $url.='/'; if (! preg_match('/\/$/',$url)) $url.='/';
$url.='view_entry.php?id='.$obj->cal_id; $url.='view_entry.php?id='.$obj->cal_id;
$event['url']=$url; $event['url']=$url;

View File

@ -80,7 +80,7 @@ if ($resql)
// 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;
$i++; $i++;
} }

View File

@ -74,7 +74,7 @@ foreach ($argv as $key => $value)
$found=false; $found=false;
// Define options // Define options
if (eregi('^lang=',$value)) if (preg_match('/^lang=/i',$value))
{ {
$found=true; $found=true;
$valarray=explode('=',$value); $valarray=explode('=',$value);
@ -122,7 +122,7 @@ foreach ($argv as $key => $value)
print 'Rebuild PDF for invoices with no payment done yet.'."\n"; print 'Rebuild PDF for invoices with no payment done yet.'."\n";
} }
if (! $found && eregi('filter=',$value)) if (! $found && preg_match('/filter=/i',$value))
{ {
usage(); usage();
exit; exit;