From c98ddbd9cb6c63f7effd45829e1ca9ff78a3a6b2 Mon Sep 17 00:00:00 2001 From: filippo.bertilotti <filippobertilotti@gmail.com> Date: Fri, 03 May 2024 10:47:19 +0200 Subject: [PATCH] aggiunta specifica restituzione tipi alle functions --- htdocs/contact.php | 5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-) diff --git a/htdocs/contact.php b/htdocs/contact.php index f22c403..1f5505c 100644 --- a/htdocs/contact.php +++ b/htdocs/contact.php @@ -32,8 +32,7 @@ /** * controlla se ci sono errori sulla digitazione dei dati messi nel form */ - - function controlloErrori(string $email, string $number, array &$errorMsgs) { + function controlloErrori(string $email, string $number, array &$errorMsgs): bool { if(!is_numeric($number) || strlen($number) != 10) { $errorMsgs['number'] = 'Numero di telefono non corretto'; }else { @@ -54,7 +53,7 @@ /** * controlla se nelle 24 ore prima non sia stata messa nel campo email la stessa mail per evitarne lo spam */ - function controlloSpamEmail(mysqli $connection, string $email) { + function controlloSpamEmail(mysqli $connection, string $email): bool { $spam = false; $query = "SELECT email, dtm_richiesta FROM Contact WHERE email = '$email' AND dtm_richiesta BETWEEN DATE_SUB(NOW(), INTERVAL 1 DAY) AND NOW();"; -- Gitblit v1.8.0