diff --git a/htdocs/admin/boutique.php b/htdocs/admin/boutique.php index ff11e57605c..0e6ce1b1f1c 100644 --- a/htdocs/admin/boutique.php +++ b/htdocs/admin/boutique.php @@ -182,7 +182,7 @@ print ""; print "".$langs->trans("Password").""; print "global->OSC_DB_PASS) . "\" size=\"30\">"; print ''; -//if ($dolibarr_main_db_pass) print '__dolibarr_main_db_pass__ ('.eregi_replace('.','*',$dolibarr_main_db_pass).')'; +//if ($dolibarr_main_db_pass) print '__dolibarr_main_db_pass__ ('.preg_replace('/./i','*',$dolibarr_main_db_pass).')'; print ' '; print ""; $var=!$var; @@ -190,7 +190,7 @@ print ""; print "".$langs->trans("PasswordRetype").""; print "global->OSC_DB_PASS) ."\" size=\"30\">"; print ''; -//if ($dolibarr_main_db_pass) print '__dolibarr_main_db_pass__ ('.eregi_replace('.','*',$dolibarr_main_db_pass).')'; +//if ($dolibarr_main_db_pass) print '__dolibarr_main_db_pass__ ('.preg_replace('/./i','*',$dolibarr_main_db_pass).')'; print ' '; print ""; print ""; diff --git a/htdocs/admin/boxes.php b/htdocs/admin/boxes.php index a16ce4d8138..dbb79c53b0f 100644 --- a/htdocs/admin/boxes.php +++ b/htdocs/admin/boxes.php @@ -32,7 +32,7 @@ $langs->load("admin"); if (!$user->admin) accessforbidden(); -// Définition des positions possibles pour les boites +// D�finition des positions possibles pour les boites $pos_array = array(0); // Positions possibles pour une boite (0,1,2,...) $pos_name = array(0=>$langs->trans("Home")); // Nom des positions 0=Homepage, 1=... $boxes = array(); @@ -170,7 +170,7 @@ if ($resql) array_push($actives,$obj->box_id); if ($obj->box_order == '' || $obj->box_order == '0' || $decalage) $decalage++; - // On renumérote l'ordre des boites si l'une d'elle est à '' + // On renum�rote l'ordre des boites si l'une d'elle est � '' // This occurs just after an insert. if ($decalage) { @@ -261,7 +261,7 @@ if ($resql) { $obj = $db->fetch_object($resql); - $module=eregi_replace('.php$','',$obj->file); + $module=preg_replace('/.php$/i','',$obj->file); include_once(DOL_DOCUMENT_ROOT."/includes/boxes/".$module.".php"); $box=new $module($db,$obj->note); @@ -269,7 +269,7 @@ if ($resql) // if (in_array($obj->rowid, $actives) && $box->box_multiple <> 1) if (in_array($obj->rowid, $actives)) { - // La boite est déjà activée + // La boite est deja activee } else { @@ -277,7 +277,7 @@ if ($resql) print '
'; print ''; - $logo=eregi_replace("^object_","",$box->boximg); + $logo=preg_replace("/^object_/i","",$box->boximg); print ''; print ''.img_object("",$logo).' '.$box->boxlabel.''; print '' . ($obj->note?$obj->note:' ') . ''; @@ -303,7 +303,7 @@ if ($resql) print ''; /* - * Boites activées + * Boites activ�es * */ @@ -346,11 +346,11 @@ if ($resql) $var = ! $var; $objnext = $db->fetch_object($resql); - $module=eregi_replace('.php$','',$obj->file); + $module=preg_replace('/.php$/i','',$obj->file); include_once(DOL_DOCUMENT_ROOT."/includes/boxes/".$module.".php"); $box=new $module($db,$obj->note); - $logo=eregi_replace("^object_","",$box->boximg); + $logo=preg_replace("/^object_/i","",$box->boximg); print ''; print ''.img_object("",$logo).' '.$box->boxlabel.''; print '' . ($obj->note?$obj->note:' ') . ''; diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index 2e358869c15..fad652a2fc0 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -484,8 +484,8 @@ if ($_GET["id"]) } $sql.=", "; // Remove from default sort order the choosed order - $tabsqlsort[$_GET["id"]]=eregi_replace($_GET["sortfield"].' '.$_GET["sortorder"].',','',$tabsqlsort[$_GET["id"]]); - $tabsqlsort[$_GET["id"]]=eregi_replace($_GET["sortfield"].',','',$tabsqlsort[$_GET["id"]]); + $tabsqlsort[$_GET["id"]]=preg_replace('/'.$_GET["sortfield"].' '.$_GET["sortorder"].',/i','',$tabsqlsort[$_GET["id"]]); + $tabsqlsort[$_GET["id"]]=preg_replace('/'.$_GET["sortfield"].',/i','',$tabsqlsort[$_GET["id"]]); } else { $sql.=" ORDER BY "; diff --git a/htdocs/admin/ldap.php b/htdocs/admin/ldap.php index 6accafca68b..d824a3beee0 100644 --- a/htdocs/admin/ldap.php +++ b/htdocs/admin/ldap.php @@ -270,13 +270,13 @@ if (function_exists("ldap_connect")) if ($result == 2) { print img_picto('','info').' '; - print ''.$langs->trans("LDAPBindOK",$conf->global->LDAP_SERVER_HOST,$conf->global->LDAP_SERVER_PORT,$conf->global->LDAP_ADMIN_DN,eregi_replace('.','*',$conf->global->LDAP_ADMIN_PASS)).''; + print ''.$langs->trans("LDAPBindOK",$conf->global->LDAP_SERVER_HOST,$conf->global->LDAP_SERVER_PORT,$conf->global->LDAP_ADMIN_DN,preg_replace('/./i','*',$conf->global->LDAP_ADMIN_PASS)).''; print '
'; } else { print img_picto('','error').' '; - print ''.$langs->trans("LDAPBindKO",$conf->global->LDAP_SERVER_HOST,$conf->global->LDAP_SERVER_PORT,$conf->global->LDAP_ADMIN_DN,eregi_replace('.','*',$conf->global->LDAP_ADMIN_PASS)).''; + print ''.$langs->trans("LDAPBindKO",$conf->global->LDAP_SERVER_HOST,$conf->global->LDAP_SERVER_PORT,$conf->global->LDAP_ADMIN_DN,preg_replace('/./i','*',$conf->global->LDAP_ADMIN_PASS)).''; print '
'; print $langs->trans("Error").' '.$ldap->error; print '
'; diff --git a/htdocs/admin/mantis.php b/htdocs/admin/mantis.php index ab587561133..51f5b9de61a 100644 --- a/htdocs/admin/mantis.php +++ b/htdocs/admin/mantis.php @@ -182,7 +182,7 @@ print ""; print "".$langs->trans("Password").""; print "global->PHPMANTIS_PASS) . "\" size=\"30\">"; print ''; -//if ($dolibarr_main_db_pass) print '__dolibarr_main_db_pass__ ('.eregi_replace('.','*',$dolibarr_main_db_pass).')'; +//if ($dolibarr_main_db_pass) print '__dolibarr_main_db_pass__ ('.preg_replace('/./i','*',$dolibarr_main_db_pass).')'; print ' '; print ""; diff --git a/htdocs/admin/menus.php b/htdocs/admin/menus.php index 4026c37f25b..faa4f6e2466 100644 --- a/htdocs/admin/menus.php +++ b/htdocs/admin/menus.php @@ -58,10 +58,10 @@ if (isset($_POST["action"]) && $_POST["action"] == 'update') // Define list of menu handlers to initialize $listofmenuhandler=array(); - $listofmenuhandler[eregi_replace('((_back|_front)office)?\.php','',$_POST["main_menu_barretop"])]=1; - $listofmenuhandler[eregi_replace('((_back|_front)office)?\.php','',$_POST["main_menufront_barretop"])]=1; - $listofmenuhandler[eregi_replace('((_back|_front)office)?\.php','',$_POST["main_menu_barreleft"])]=1; - $listofmenuhandler[eregi_replace('((_back|_front)office)?\.php','',$_POST["main_menufront_barreleft"])]=1; + $listofmenuhandler[preg_replace('/((_back|_front)office)?\.php/i','',$_POST["main_menu_barretop"])]=1; + $listofmenuhandler[preg_replace('/((_back|_front)office)?\.php/i','',$_POST["main_menufront_barretop"])]=1; + $listofmenuhandler[preg_replace('/((_back|_front)office)?\.php/i','',$_POST["main_menu_barreleft"])]=1; + $listofmenuhandler[preg_replace('/((_back|_front)office)?\.php/i','',$_POST["main_menufront_barreleft"])]=1; foreach ($listofmenuhandler as $key => $val) { //print "x".$key; @@ -181,11 +181,11 @@ else $var=!$var; print ''.$langs->trans("DefaultMenuTopManager").''; print ''; - $filelib=eregi_replace('\.php$','',$conf->global->MAIN_MENU_BARRETOP); + $filelib=preg_replace('/.php$/i','',$conf->global->MAIN_MENU_BARRETOP); print $filelib; print ''; print ''; - $filelib=eregi_replace('\.php$','',$conf->global->MAIN_MENUFRONT_BARRETOP); + $filelib=preg_replace('/.php$/i','',$conf->global->MAIN_MENUFRONT_BARRETOP); print $filelib; print ''; print ''; @@ -194,11 +194,11 @@ else print ''; print ''.$langs->trans("DefaultMenuLeftManager").''; print ''; - $filelib=eregi_replace('\.php$','',$conf->global->MAIN_MENU_BARRELEFT); + $filelib=preg_replace('/.php$/i','',$conf->global->MAIN_MENU_BARRELEFT); print $filelib; print ''; print ''; - $filelib=eregi_replace('\.php$','',$conf->global->MAIN_MENUFRONT_BARRELEFT); + $filelib=preg_replace('/.php$/i','',$conf->global->MAIN_MENUFRONT_BARRELEFT); print $filelib; print ''; print ''; diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php index 0596970156b..bf3ccfb4a39 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -166,10 +166,10 @@ function UnActivate($value,$requiredby=1) else { $genericMod = new DolibarrModules($db); - $genericMod->name=eregi_replace('^mod','',$modName); + $genericMod->name=preg_replace('/^mod/i','',$modName); $genericMod->style_sheet=1; - $genericMod->rights_class=strtolower(eregi_replace('^mod','',$modName)); - $genericMod->const_name='MAIN_MODULE_'.strtoupper(eregi_replace('^mod','',$modName)); + $genericMod->rights_class=strtolower(preg_replace('/^mod/i','',$modName)); + $genericMod->const_name='MAIN_MODULE_'.strtoupper(preg_replace('/^mod/i','',$modName)); dol_syslog("modules::UnActivate Failed to find module file, we use generic function with name ".$genericMod->name); $genericMod->_remove(); } @@ -244,7 +244,7 @@ foreach ($conf->file->dol_document_root as $dirroot) if (! empty($objMod->needtopmenu) && sizeof($objMod->needtopmenu) && ! in_array($conf->top_menu,$objMod->needtopmenu)) $modulequalified=0; // We discard modules according to features level (PS: if module is activated we always show it) - $const_name = 'MAIN_MODULE_'.strtoupper(eregi_replace('^mod','',get_class($objMod))); + $const_name = 'MAIN_MODULE_'.strtoupper(preg_replace('/^mod/i','',get_class($objMod))); if ($objMod->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2 && ! $conf->global->$const_name) $modulequalified=0; if ($objMod->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1 && ! $conf->global->$const_name) $modulequalified=0; @@ -364,7 +364,7 @@ foreach ($orders as $key => $value) $modName = $filename[$key]; $objMod = $modules[$key]; - $const_name = 'MAIN_MODULE_'.strtoupper(eregi_replace('^mod','',get_class($objMod))); + $const_name = 'MAIN_MODULE_'.strtoupper(preg_replace('/^mod/i','',get_class($objMod))); // Load all lang files of module if (isset($objMod->langfiles) && is_array($objMod->langfiles)) diff --git a/htdocs/admin/paybox.php b/htdocs/admin/paybox.php index e017aa8b352..4d1dbbec0a4 100644 --- a/htdocs/admin/paybox.php +++ b/htdocs/admin/paybox.php @@ -160,8 +160,10 @@ print '

'; print ''.$langs->trans("FollowingUrlAreAvailableToMakePayments").':
'; // Should work with DOL_URL_ROOT='' or DOL_URL_ROOT='/dolibarr' $firstpart=$dolibarr_main_url_root; -$regex=DOL_URL_ROOT.'$'; -$firstpart=eregi_replace($regex,'',$firstpart); +$slash = '/'; +$backslash = strtr($slash, '/', '\\'); +$regex='/'.$backslash.DOL_URL_ROOT.'$/i'; +$firstpart=preg_replace($regex,'',$firstpart); print '
'; print img_picto('','puce.png').' '.$langs->trans("ToOfferALinkForOnlinePaymentOnFreeAmount",$servicename).':
'; print ''.$firstpart.DOL_URL_ROOT.'/public/paybox/newpayment.php?amount=9.99&tag=your_free_tag'."
\n"; diff --git a/htdocs/admin/webcalendar.php b/htdocs/admin/webcalendar.php index 11a1d96458b..03379ba2df7 100644 --- a/htdocs/admin/webcalendar.php +++ b/htdocs/admin/webcalendar.php @@ -202,7 +202,7 @@ print ""; print "".$langs->trans("Password").""; print "global->PHPWEBCALENDAR_PASS) . "\" size=\"30\">"; print ''; -//if ($dolibarr_main_db_pass) print '__dolibarr_main_db_pass__ ('.eregi_replace('.','*',$dolibarr_main_db_pass).')'; +//if ($dolibarr_main_db_pass) print '__dolibarr_main_db_pass__ ('.preg_replace('/./i','*',$dolibarr_main_db_pass).')'; print ' '; print ""; @@ -313,7 +313,9 @@ print "
"; // Show message $message=''; -$urlwithouturlroot=eregi_replace(DOL_URL_ROOT.'$','',$dolibarr_main_url_root); +$slash = '/'; +$backslash = strtr($slash, '/', '\\'); +$urlwithouturlroot=eregi_replace('/'.$backslash.DOL_URL_ROOT.'$/i','',$dolibarr_main_url_root); $urlvcal=''.$urlwithouturlroot.DOL_URL_ROOT.'/webcal/webcalexport.php?format=vcal&exportkey='.$conf->global->PHPWEBCALENDAR_PASSWORD_VCALEXPORT.''; $message.=$langs->trans("WebCalUrlForVCalExport",'vcal',$urlvcal); $message.='
'; diff --git a/htdocs/admin/webservices.php b/htdocs/admin/webservices.php index 1beffb9dd64..ab8173d9cca 100644 --- a/htdocs/admin/webservices.php +++ b/htdocs/admin/webservices.php @@ -92,7 +92,9 @@ print '

'; // Should work with DOL_URL_ROOT='' or DOL_URL_ROOT='/dolibarr' $firstpart=$dolibarr_main_url_root; -$regex=DOL_URL_ROOT.'$'; +$slash = '/'; +$backslash = strtr($slash, '/', '\\'); +$regex='/'.$backslash.DOL_URL_ROOT.'$/i'; $firstpart=eregi_replace($regex,'',$firstpart); print ''.$langs->trans("WSDLCanBeDownloadedHere").':
';