diff --git a/include/util/util.php b/include/util/util.php index 806012e6..ef72b6b4 100644 --- a/include/util/util.php +++ b/include/util/util.php @@ -143,14 +143,25 @@ function contains_phone_number($string) { return(false); } + +/* + * dd/mm/yyyy + * dd/mm/yyyy HH:mm + */ function is_date($date) { - if (strlen($date) != 10) + /* É chamada também com esse formato + * dd/mm/yyyy HH:mm + * Portanto precisa ser mantido o < 10 + * 10 verifica se tem o mínimo para procurar + */ + + if (strlen($date) < 10) return(False); else { // Check if the date is valid $dt = preg_split('~/~', $date); - return(checkdate($dt[1], $dt[0], $dt[2])); + return(checkdate((int)$dt[1], (int)$dt[0], (int)$dt[2])); } }