diff --git a/htdocs/bourse.php b/htdocs/bourse.php index da754cc..63fcddb 100644 --- a/htdocs/bourse.php +++ b/htdocs/bourse.php @@ -40,7 +40,7 @@ if (is_file($filename)) { $handle = fopen($filename, "r"); while (!feof($handle)) { $r = fgets($handle); - if (ereg(';', $r)) $last = $r; + if (preg_match('#;#', $r)) $last = $r; } fclose($handle); $calc = $last = explode(';', $last); @@ -53,7 +53,7 @@ for($i = 6; $i >= 0; $i--){ $handle = fopen($filename, "r"); while (!feof($handle)) { $r = fgets($handle); - if (ereg(';', $r)) $last = $r; + if (preg_match('#;#', $r)) $last = $r; } fclose($handle); $last = explode(';', $last); diff --git a/htdocs/integrite.php b/htdocs/integrite.php index 0a7b261..9dadecd 100644 --- a/htdocs/integrite.php +++ b/htdocs/integrite.php @@ -34,7 +34,7 @@ if (is_file(FILE_SAV) && !isset($_GET['erase'])) $pointeur = opendir($dir); while ($fichier = readdir($pointeur)) { - if($fichier == '.' || $fichier == '..' || $fichier == '.svn' || ereg("~", $fichier)) + if($fichier == '.' || $fichier == '..' || $fichier == '.svn' || preg_match("#~#", $fichier)) continue; if(is_dir($dir.$fichier) && is_readable($dir.$fichier)) @@ -115,7 +115,7 @@ else $pointeur = opendir($dir); while ($fichier = readdir($pointeur)) { - if($fichier == '.' || $fichier == '..' || $fichier == '.svn' || ereg("~", $fichier)) + if($fichier == '.' || $fichier == '..' || $fichier == '.svn' || preg_match("#~#", $fichier)) continue; if(is_dir($dir.$fichier) && is_readable($dir.$fichier)) diff --git a/htdocs/lectlog.php b/htdocs/lectlog.php index 60bd8fb..21a31f0 100644 --- a/htdocs/lectlog.php +++ b/htdocs/lectlog.php @@ -70,7 +70,7 @@ else '; foreach($m[0] as $key => $lign) { - if (ereg('array', $m[3][$key])) + if (preg_match('#array#', $m[3][$key])) { $exp = "#array \(( '(.{1,10})' => '([^',]{0,1000})',)( '(.{1,10})' => '([^',]{0,1000})',)?( '(.{1,10})' => '([^',]{0,1000})',)?( '(.{1,10})' => '([^',]{0,1000})',)?( '(.{1,10})' => '([^',]{0,1000})',)?( '(.{1,10})' => '([^',]{0,1000})',)?( '(.{1,10})' => '([^',]{0,1000})',)?( '(.{1,10})' => '([^',]{0,1000})',)?( '(.{1,10})' => '([^',]{0,1000})',)?( '(.{1,10})' => '([^',]{0,1000})',)?( '(.{1,10})' => '([^',]{0,1000})',)?( '(.{1,10})' => '([^',]{0,1000})',)?( '(.{1,10})' => '([^',]{0,1000})',)?( '(.{1,10})' => '([^',]{0,1000})',)?( '(.{1,10})' => '([^',]{0,1000})',)?( '(.{1,10})' => '([^',]{0,1000})',)?( '(.{1,10})' => '([^',]{0,1000})',)?( '(.{1,10})' => '([^',]{0,1000})',)?( '(.{1,10})' => '([^',]{0,1000})',)?( '(.{1,10})' => '([^',]{0,1000})',)?( '(.{1,10})' => '([^',]{0,1000})',)?( '(.{1,10})' => '([^',]{0,1000})',)?( '(.{1,10})' => '([^',]{0,1000})',)?( '(.{1,10})' => '([^',]{0,1000})',)?( '(.{1,10})' => '([^',]{0,1000})',)?( '(.{1,10})' => '([^',]{0,1000})',)?( '(.{1,10})' => '([^',]{0,1000})',)?( '(.{1,10})' => '([^',]{0,1000})',)?( '(.{1,10})' => '([^',]{0,1000})',)?( '(.{1,10})' => '([^',]{0,1000})',)?( '(.{1,10})' => '([^',]{0,1000})',)?( '(.{1,10})' => '([^',]{0,1000})',)?( '(.{1,10})' => '([^',]{0,1000})',)?( '(.{1,10})' => '([^',]{0,1000})',)?( '(.{1,10})' => '([^',]{0,1000})',)?( '(.{1,10})' => '([^',]{0,1000})',)?( '(.{1,10})' => '([^',]{0,1000})',)?( '(.{1,10})' => '([^',]{0,1000})',)?( '(.{1,10})' => '([^',]{0,1000})',)?( '(.{1,10})' => '([^',]{0,1000})',)?( '(.{1,10})' => '([^',]{0,1000})',)?( '(.{1,10})' => '([^',]{0,1000})',)?( '(.{1,10})' => '([^',]{0,1000})',)?( '(.{1,10})' => '([^',]{0,1000})',)?( '(.{1,10})' => '([^',]{0,1000})',)?( '(.{1,10})' => '([^',]{0,1000})',)?( '(.{1,10})' => '([^',]{0,1000})',)?#ui"; diff --git a/onyx2/include/Class/alliance.php b/onyx2/include/Class/alliance.php index b3e4f41..7a5a816 100644 --- a/onyx2/include/Class/alliance.php +++ b/onyx2/include/Class/alliance.php @@ -109,7 +109,7 @@ class Alliance extends SURFACE{ else $out[] .= $this->modif[$i]." = '".$this->{$this->modif[$i]}."'"; } else { - if (ereg('file', $this->modif[$i])) { + if (preg_match('#file#', $this->modif[$i])) { $prep = serialize($this->{$this->modif[$i]}); $bdd->escape($prep); $out[] .= $this->modif[$i]." = '$prep'"; diff --git a/onyx2/include/admin/bdd.php b/onyx2/include/admin/bdd.php index 2e56121..cd1ff35 100644 --- a/onyx2/include/admin/bdd.php +++ b/onyx2/include/admin/bdd.php @@ -14,7 +14,7 @@ if(!defined('INDEX')) { header('Location: ../'); exit; } $template->assign("affected", $bdd->affected()); $bdd->deconnexion(); - if (eregi("show tables", $req)) + if (preg_match("#show tables#i", $req)) $template->assign("lien", "SELECT * FROM "); $pagea = 'bdd'; diff --git a/onyx2/include/function.php b/onyx2/include/function.php index a22c3e8..019d1fb 100644 --- a/onyx2/include/function.php +++ b/onyx2/include/function.php @@ -243,11 +243,11 @@ function check_mdp($mdp, $pseudo = null, $conf=null) return "Mot de passe trop court, il doit faire au moins 7 caractères."; elseif (ctype_digit($mdp)) return "Le mot de passe ne doit pas contenir que des chiffres"; - elseif (!empty($pseudo) && ereg($mdp, $pseudo)) + elseif (!empty($pseudo) && strpos($mdp, $pseudo)) return "Votre mot de passe ne doit pas être une partie de votre nom d'utilisateur"; - elseif (!empty($pseudo) && ereg($pseudo, $mdp)) + elseif (!empty($pseudo) && strpos($pseudo, $mdp)) return "Votre nom d'utilisateur ne doit pas être une partie de votre mot de passe"; - elseif (ereg("halo", $mdp)) + elseif (strpos($mdp, "halo")) return "Le mot de passe ne peut pas contenir le mot halo !"; elseif (preg_match("#azer|qwer|zert|wert|erty|rtyu|tyui|yuio|uiop|poiu|oiuy|iuyt|uytr|ytre|trez|trew|reza|rewq|qsdf|asdf|sdfg|dfgh|fghj|ghjk|hjkl|jklm|mlkj|lkjh|kjhg|jhgf|hgfd|gfds|fdsq|fdsa|wxcv|vcxw|xcvb|bvcx|cvbn|nbvc|vbnm|mnbv|123|234|345|456|567|678|789|987|876|765|654|543|432|321|210|012#iU", $mdp, $osef)) return "Ayez plus de créativité pour définir votre mot de passe, les lettres ou chiffres du clavier qui se suivent ne sont pas une bonne sécurité !"; diff --git a/onyx2/tpl/admin/print.tpl b/onyx2/tpl/admin/print.tpl index d683eb9..4c6d252 100644 --- a/onyx2/tpl/admin/print.tpl +++ b/onyx2/tpl/admin/print.tpl @@ -4,7 +4,7 @@ {foreach from=$tableau item=ligne key=key} {$key} - {if $ligne > 0 && (ereg("^time", $key) || $key == "last_visite" || $key == "politique_lastchange")}{$ligne|date_format:"timestamp : %d/%m/%y %H:%M:%S"}{else}{$ligne|truncate:82}{/if} + {if $ligne > 0 && (preg_match("#^time#", $key) || $key == "last_visite" || $key == "politique_lastchange")}{$ligne|date_format:"timestamp : %d/%m/%y %H:%M:%S"}{else}{$ligne|truncate:82}{/if} {/foreach}