Browse Source

Merge branch 'dev' into echo_query

1.8.1-monitor
bruno 1 year ago
parent
commit
772ce28d67
  1. 4
      include/util/datas.php
  2. 4
      include/util/util.php

4
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;

4
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);
}

Loading…
Cancel
Save