diff --git a/build/exe/doliwamp/index.php.install b/build/exe/doliwamp/index.php.install
index 849fae18c23..08270e7ee3f 100644
--- a/build/exe/doliwamp/index.php.install
+++ b/build/exe/doliwamp/index.php.install
@@ -345,7 +345,7 @@ if (is_dir($aliasDir))
foreach($listoffiles as $file)
{
- if (is_file($aliasDir.$file) && ereg('.conf',$file))
+ if (is_file($aliasDir.$file) && preg_match('/\.conf/',$file))
{
$msg = '';
diff --git a/htdocs/adherents/fiche.php b/htdocs/adherents/fiche.php
index e7ebf26138f..ff6af0af7e4 100644
--- a/htdocs/adherents/fiche.php
+++ b/htdocs/adherents/fiche.php
@@ -250,7 +250,7 @@ if ($_REQUEST["action"] == 'update' && ! $_POST["cancel"] && $user->rights->adhe
foreach($_POST as $key => $value)
{
- if (ereg("^options_",$key))
+ if (preg_match("/^options_/",$key))
{
//escape values from POST, at least with addslashes, to avoid obvious SQL injections
//(array_options is directly input in the DB in adherent.class.php::update())
@@ -374,7 +374,7 @@ if ($_POST["action"] == 'add' && $user->rights->adherent->creer)
$adh->fk_soc = $socid;
foreach($_POST as $key => $value)
{
- if (ereg("^options_",$key))
+ if (preg_match("/^options_/",$key))
{
//escape values from POST, at least with addslashes, to avoid obvious SQL injections
//(array_options is directly input in the DB in adherent.class.php::update())
diff --git a/htdocs/admin/triggers.php b/htdocs/admin/triggers.php
index 0f9b3a3f778..040b717766a 100644
--- a/htdocs/admin/triggers.php
+++ b/htdocs/admin/triggers.php
@@ -136,7 +136,7 @@ $orders = array();
$i = 0;
while (($file = readdir($handle))!==false)
{
- if (is_readable($dir.'/'.$file) && ereg('^interface_([^_]+)_(.+)\.class\.php',$file,$reg))
+ if (is_readable($dir.'/'.$file) && preg_match('/^interface_([^_]+)_(.+)\.class\.php/',$file,$reg))
{
$modName = 'Interface'.ucfirst($reg[2]);
//print "file=$file"; print "modName=$modName"; exit;
diff --git a/htdocs/lib/ldap.class.php b/htdocs/lib/ldap.class.php
index 7f6fa9e0b63..91c04de6bf6 100644
--- a/htdocs/lib/ldap.class.php
+++ b/htdocs/lib/ldap.class.php
@@ -150,7 +150,7 @@ class Ldap
{
foreach ($this->server as $key => $host)
{
- if (ereg('^ldap',$host))
+ if (preg_match('/^ldap/',$host))
{
$this->connection = ldap_connect($host);
}
@@ -198,7 +198,7 @@ class Ldap
{
if ($connected) break;
- if (ereg('^ldap',$host))
+ if (preg_match('/^ldap/',$host))
{
$this->connection = ldap_connect($host);
}
@@ -635,7 +635,7 @@ class Ldap
$content='';
// Create file content
- if (ereg('^ldap',$this->server[0]))
+ if (preg_match('/^ldap/',$this->server[0]))
{
$target="-H ".join(',',$this->server);
}
diff --git a/htdocs/public/members/new.php b/htdocs/public/members/new.php
index 25916b8cb37..e1ec93b908a 100644
--- a/htdocs/public/members/new.php
+++ b/htdocs/public/members/new.php
@@ -96,7 +96,7 @@ if ($_POST["action"] == 'add')
$error+=1;
$errmsg .= $langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Name"))."
\n";
}
- if (!isset($_POST["email"]) || $_POST["email"] == '' || !ereg('@',$_POST["email"]))
+ if (!isset($_POST["email"]) || $_POST["email"] == '' || !preg_match('/@/',$_POST["email"]))
{
$error+=1;
$errmsg .= $langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("EMail"))."
\n";
@@ -151,7 +151,7 @@ if ($_POST["action"] == 'add')
$adh->morphy = $_POST["morphy"];
foreach($_POST as $key => $value){
- if (ereg("^options_",$key)){
+ if (preg_match("/^options_/",$key)){
$adh->array_options[$key]=$_POST[$key];
}
}