From 9038308a4077682443220ffd6c8bd8bf1b1d26fa Mon Sep 17 00:00:00 2001 From: bruno Date: Mon, 5 Jun 2023 17:11:25 -0400 Subject: [PATCH] =?UTF-8?q?Fun=C3=A7=C3=A3o=20ereg=20do=20php=20est=C3=A1?= =?UTF-8?q?=20obsoleta,=20usar=20preg=5Fmatch=20Esta=20fun=C3=A7=C3=A3o=20?= =?UTF-8?q?est=C3=A1=20OBSOLETA=20no=20PHP=205.3.0=20e=20foi=20REMOVIDA=20?= =?UTF-8?q?no=20PHP=207.0.0.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- include/util/datas.php | 4 ++-- include/util/util.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) 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); }