diff --git a/htdocs/admin/agenda_xcal.php b/htdocs/admin/agenda_xcal.php
index 9a204f9912c..735cc8f268a 100644
--- a/htdocs/admin/agenda_xcal.php
+++ b/htdocs/admin/agenda_xcal.php
@@ -120,14 +120,16 @@ print "
";
// Show message
$message='';
-//$urlwithouturlroot=eregi_replace(DOL_URL_ROOT.'$','',$dolibarr_main_url_root);
-$urlvcal=''.$dolibarr_main_url_root.'/comm/action/agendaexport.php?format=vcal&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY):'KEYNOTDEFINED').'';
+$slash = '/';
+$backslash = strtr($slash, '/', '\\');
+$urlwithouturlroot=preg_replace('/'.$backslash.DOL_URL_ROOT.'$/i','',$dolibarr_main_url_root);
+$urlvcal=''.$urlwithouturlroot.DOL_URL_ROOT.'/comm/action/agendaexport.php?format=vcal&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY):'KEYNOTDEFINED').'';
$message.=$langs->trans("WebCalUrlForVCalExport",'vcal',$urlvcal);
$message.='
';
-$urlical=''.$dolibarr_main_url_root.'/comm/action/agendaexport.php?format=ical&type=event&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY):'KEYNOTDEFINED').'';
+$urlical=''.$urlwithouturlroot.DOL_URL_ROOT.'/comm/action/agendaexport.php?format=ical&type=event&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY):'KEYNOTDEFINED').'';
$message.=$langs->trans("WebCalUrlForVCalExport",'ical',$urlical);
$message.='
';
-$urlrss=''.$dolibarr_main_url_root.'/comm/action/agendaexport.php?format=rss&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY):'KEYNOTDEFINED').'';
+$urlrss=''.$urlwithouturlroot.DOL_URL_ROOT.'/comm/action/agendaexport.php?format=rss&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY):'KEYNOTDEFINED').'';
$message.=$langs->trans("WebCalUrlForVCalExport",'rss',$urlrss);
$message.='
';
$message.='
';
diff --git a/htdocs/admin/phenix.php b/htdocs/admin/phenix.php
index 45a4db865da..ddf3f809833 100644
--- a/htdocs/admin/phenix.php
+++ b/htdocs/admin/phenix.php
@@ -204,7 +204,7 @@ print "
";
print "| ".$langs->trans("Password")." | ";
print "global->PHPPHENIX_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/syslog.php b/htdocs/admin/syslog.php
index 38fff5d961f..3b8d72dc973 100644
--- a/htdocs/admin/syslog.php
+++ b/htdocs/admin/syslog.php
@@ -67,7 +67,7 @@ if (! empty($_POST["action"]) && $_POST["action"] == 'set')
if ($optionlogoutput == "file")
{
$filelog=$_POST["filename"];
- $filelog=eregi_replace('DOL_DATA_ROOT',DOL_DATA_ROOT,$filelog);
+ $filelog=preg_replace('/DOL_DATA_ROOT/i',DOL_DATA_ROOT,$filelog);
$file=fopen($filelog,"a+");
if ($file)
{
diff --git a/htdocs/admin/triggers.php b/htdocs/admin/triggers.php
index d8fe9fbab9f..0f9b3a3f778 100644
--- a/htdocs/admin/triggers.php
+++ b/htdocs/admin/triggers.php
@@ -189,7 +189,7 @@ foreach ($orders as $key => $value)
if (eregi('^interface_([^_]+)_(.+)\.class\.php',$files[$key],$reg))
{
// Check if trigger file is for a particular module
- $module=eregi_replace('^mod','',$reg[1]);
+ $module=preg_replace('/^mod/i','',$reg[1]);
$constparam='MAIN_MODULE_'.strtoupper($module);
if (strtolower($reg[1]) == 'all') $disabledbymodule=0;
else if (empty($conf->global->$constparam)) $disabledbymodule=2;
diff --git a/htdocs/admin/webcalendar.php b/htdocs/admin/webcalendar.php
index 03379ba2df7..9918a344c18 100644
--- a/htdocs/admin/webcalendar.php
+++ b/htdocs/admin/webcalendar.php
@@ -315,7 +315,7 @@ print "
";
$message='';
$slash = '/';
$backslash = strtr($slash, '/', '\\');
-$urlwithouturlroot=eregi_replace('/'.$backslash.DOL_URL_ROOT.'$/i','',$dolibarr_main_url_root);
+$urlwithouturlroot=preg_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 ab8173d9cca..55795db4524 100644
--- a/htdocs/admin/webservices.php
+++ b/htdocs/admin/webservices.php
@@ -95,7 +95,7 @@ $firstpart=$dolibarr_main_url_root;
$slash = '/';
$backslash = strtr($slash, '/', '\\');
$regex='/'.$backslash.DOL_URL_ROOT.'$/i';
-$firstpart=eregi_replace($regex,'',$firstpart);
+$firstpart=preg_replace($regex,'',$firstpart);
print ''.$langs->trans("WSDLCanBeDownloadedHere").':
';
$url=$firstpart.DOL_URL_ROOT.'/webservices/server.php?wsdl';