diff --git a/bureau/class/config_real.php b/bureau/class/config_real.php index 6a770acb..16d644b1 100644 --- a/bureau/class/config_real.php +++ b/bureau/class/config_real.php @@ -84,7 +84,7 @@ $classes=array(); /* CLASSES PHP : automatic include : */ $c=opendir($root."class/"); while ($di=readdir($c)) { - if (ereg("^m_(.*)\\.php$",$di,$match)) { // $ + if (preg_match("#^m_(.*)\\.php$#",$di,$match)) { // $ $name1="m_".$match[1]; $name2=$match[1]; $classes[]=$name2; diff --git a/bureau/class/functions.php b/bureau/class/functions.php index f3ce2a7b..239978e6 100644 --- a/bureau/class/functions.php +++ b/bureau/class/functions.php @@ -190,7 +190,7 @@ function checkfqdn($fqdn) { // Note: a.foo.net is a valid domain // Note: RFC1035 tells us that a domain should not start by a digit, but every registrar allows such a domain to be created ... too bad. - if (!eregi("^[a-z0-9]([a-z0-9-]*[a-z0-9])?$",$val)) { + if (!preg_match("#^[a-z0-9]([a-z0-9-]*[a-z0-9])?$#i",$val)) { return 3; } } diff --git a/bureau/class/m_admin.php b/bureau/class/m_admin.php index 7c4f6f9c..8b4533c3 100644 --- a/bureau/class/m_admin.php +++ b/bureau/class/m_admin.php @@ -328,7 +328,7 @@ class m_admin { } // Vérification de la conformité du login $login=strtolower($login); - if (!ereg("^[a-z0-9]*$",$login)) { //$ + if (!preg_match("#^[a-z0-9]*$#",$login)) { //$ $err->raise("admin", "Login can only contains characters a-z and 0-9"); return false; } diff --git a/bureau/class/m_dom.php b/bureau/class/m_dom.php index 2a47d71e..aa6ac616 100644 --- a/bureau/class/m_dom.php +++ b/bureau/class/m_dom.php @@ -453,7 +453,7 @@ class m_dom { $err->log("dom","whois",$domain); // pour ajouter un nouveau TLD, utiliser le code ci-dessous. // echo "whois : $domain
"; - ereg(".*\.([^\.]*)",$domain,$out); + preg_match("#.*\.([^\.]*)#",$domain,$out); $ext=$out[1]; // pour ajouter un nouveau TLD, utiliser le code ci-dessous. // echo "ext: $ext
"; @@ -464,7 +464,7 @@ class m_dom { $state=0; while (!feof($fp)) { $ligne = fgets($fp,128); - if (ereg('^whois:[[:space:]]+.*$', $ligne)) { $serveur=preg_replace('/whois:\ */','',$ligne,1); } + if (preg_match('#^whois:#', $ligne)) { $serveur=preg_replace('/whois:\ */','',$ligne,1); } } } @@ -495,15 +495,15 @@ class m_dom { case "biz": case "name": case "cc": - if (ereg("Name Server:", $ligne)) { + if (preg_match("#Name Server:#", $ligne)) { $found = true; - $tmp=strtolower(ereg_replace(chr(10), "",ereg_replace(chr(13),"",ereg_replace(" ","", ereg_replace("Name Server:","", $ligne))))); + $tmp=strtolower(str_replace(chr(10), "",str_replace(chr(13),"",str_replace(" ","", str_replace("Name Server:","", $ligne))))); if ($tmp) $server[]=$tmp; } break; case "cx": - $ligne = ereg_replace(chr(10), "",ereg_replace(chr(13),"",ereg_replace(" ","", $ligne))); + $ligne = str_replace(chr(10), "",str_replace(chr(13),"",str_replace(" ","", $ligne))); if ($ligne=="" && $state==1) $state=2; if ($state==1) @@ -536,7 +536,7 @@ class m_dom { } break; case "it": - if (ereg("nserver:", $ligne)) { + if (preg_match("#nserver:#", $ligne)) { $found=true; $tmp=strtolower(preg_replace("/nserver:\s*[^ ]*\s*([^\s]*)$/","\\1", $ligne)); if ($tmp) @@ -545,20 +545,20 @@ class m_dom { break; case "fr": case "re": - if (ereg("nserver:", $ligne)) { + if (preg_match("#nserver:#", $ligne)) { $found=true; - $tmp=strtolower(preg_replace("/nserver:\s*([^\s]*)\s*.*$/","\\1", $ligne)); + $tmp=strtolower(preg_replace("#nserver:\s*([^\s]*)\s*.*$#","\\1", $ligne)); if ($tmp) $server[]=$tmp; } break; case "ca": case "ws"; - if (ereg('^[[:space:]]*Name servers:[[:space:]]*$', $ligne)) { + if (preg_match('#Name servers#', $ligne)) { // found the server $state = 1; } elseif ($state) { - if (ereg('^[^%]', $ligne) && $ligne = ereg_replace('[[:space:]]', "", $ligne)) { + if (preg_match('#^[^%]#', $ligne) && $ligne = preg_replace('#[[:space:]]#', "", $ligne)) { // first non-whitespace line is considered to be the nameservers themselves $found = true; $server[] = $ligne; @@ -566,7 +566,7 @@ class m_dom { } break; case "coop": - if (preg_match('/Host Name:\s*([^\s]+)/', $ligne, $matches)) { + if (preg_match('#Host Name:\s*([^\s]+)#', $ligne, $matches)) { $found = true; $server[] = $matches[1]; } diff --git a/bureau/class/m_mem.php b/bureau/class/m_mem.php index 946dda73..81e10509 100644 --- a/bureau/class/m_mem.php +++ b/bureau/class/m_mem.php @@ -492,8 +492,8 @@ Cordialement. if ($this->user["show_help"] || $force) { $hlp=_("hlp_$file"); if ($hlp!="hlp_$file") { - $hlp=ereg_replace( - "HELPID_([0-9]*)", + $hlp=preg_replace( + "#HELPID_([0-9]*)#", "\""._("Help")."\"",$hlp); echo "

".$hlp."

"; return true; diff --git a/bureau/class/m_mysql.php b/bureau/class/m_mysql.php index f900ddd4..8f742287 100644 --- a/bureau/class/m_mysql.php +++ b/bureau/class/m_mysql.php @@ -135,7 +135,7 @@ class m_mysql { $err->raise("mysql",1); return false; } - if (!ereg("^[0-9a-z]*$",$dbn)) { + if (!preg_match("#^[0-9a-z]*$#",$dbn)) { $err->raise("mysql",2); return false; } @@ -218,7 +218,7 @@ class m_mysql { function put_mysql_backup($dbn,$bck_mode,$bck_history,$bck_gzip,$bck_dir) { global $db,$err,$mem,$bro,$cuid; $err->log("mysql","put_mysql_backup"); - if (!ereg("^[0-9a-z]*$",$dbn)) { + if (!preg_match("#^[0-9a-z]*$#",$dbn)) { $err->raise("mysql",2); return false; } @@ -443,7 +443,7 @@ class m_mysql { $err->raise("mysql",13); return false; } - if (!ereg("^[0-9a-z]",$usern)) { + if (!preg_match("#^[0-9a-z]#",$usern)) { $err->raise("mysql",14); return false; } @@ -519,7 +519,7 @@ class m_mysql { function del_user($user) { global $db,$err,$mem,$cuid,$L_MYSQL_DATABASE; $err->log("mysql","del_user",$user); - if (!ereg("^[0-9a-z]",$user)) { + if (!preg_match("#^[0-9a-z]#",$user)) { $err->raise("mysql",14); return false; }