diff --git a/include/util/datas.php b/include/util/datas.php index f9747f29..65471e41 100644 --- a/include/util/datas.php +++ b/include/util/datas.php @@ -61,7 +61,7 @@ class CalcDataHora { switch ($op) { case "d": // Padrao: 15/01/2007 $er = "(([0][1-9]|[1-2][0-9]|[3][0-1])\/([0][1-9]|[1][0-2])\/([0-9]{4}))"; - if (ereg($er, $data)) { + if ( preg_match($er, $data)) { return 0; } else { return 1; @@ -69,7 +69,7 @@ class CalcDataHora { break; case "dh": // Padrao 15/01/2007 10:30:00 $er = "(([0][1-9]|[1-2][0-9]|[3][0-1])\/([0][1-9]|[1][0-2])\/([0-9]{4})*)"; - if (ereg($er, $data)) { + if ( preg_match($er, $data)) { return 0; } else { return 1; diff --git a/include/util/util.php b/include/util/util.php index 84c134e7..1bb56add 100644 --- a/include/util/util.php +++ b/include/util/util.php @@ -40,7 +40,7 @@ function _is_valid($string, $min_length, $max_length, $regex) { } // Does the string entirely consist of characters of $type? - if (!eregi("^$regex$", $string)) { + if (!preg_match("^$regex$", $string)) { return(false); } @@ -135,7 +135,7 @@ function contains_bad_words($string) { function contains_phone_number($string) { // Check for phone number - if (ereg("[[:digit:]]{3,10}[\. /\)\(-]*[[:digit:]]{6,10}", $string)) { + if (preg_match("[[:digit:]]{3,10}[\. /\)\(-]*[[:digit:]]{6,10}", $string)) { return(true); }