@@ -600,12 +600,14 @@ function adjustBrightness($hexCode, $adjustPercent)
600600
601601if (!function_exists ('blurEmail ' )) {
602602 /**
603- * Funzione per offuscare parzialmente un indirizzo email
603+ * Funzione per offuscare parzialmente un indirizzo email.
604604 *
605605 * @param string $email Indirizzo email da offuscare
606+ *
606607 * @return string Email offuscata con asterischi
607608 */
608- function blurEmail ($ email ) {
609+ function blurEmail ($ email )
610+ {
609611 if (empty ($ email ) || !filter_var ($ email , FILTER_VALIDATE_EMAIL )) {
610612 return $ email ;
611613 }
@@ -618,21 +620,21 @@ function blurEmail($email) {
618620
619621 if ($ username_length <= 2 ) {
620622 // Se il nome utente è molto corto, mostra solo il primo carattere
621- $ blurred_username = substr ($ username , 0 , 1 ) . str_repeat ('* ' , max (1 , $ username_length - 1 ));
623+ $ blurred_username = substr ($ username , 0 , 1 ). str_repeat ('* ' , max (1 , $ username_length - 1 ));
622624 } elseif ($ username_length <= 4 ) {
623625 // Per nomi utente corti, mostra primi 2 caratteri
624- $ blurred_username = substr ($ username , 0 , 2 ) . str_repeat ('* ' , $ username_length - 2 );
626+ $ blurred_username = substr ($ username , 0 , 2 ). str_repeat ('* ' , $ username_length - 2 );
625627 } else {
626628 // Per nomi utente lunghi, mostra primi 2 e ultimi 1 carattere
627629 $ visible_start = 2 ;
628630 $ visible_end = 1 ;
629631 $ stars_count = max (3 , $ username_length - $ visible_start - $ visible_end );
630632
631- $ blurred_username = substr ($ username , 0 , $ visible_start ) .
632- str_repeat ('* ' , $ stars_count ) .
633+ $ blurred_username = substr ($ username , 0 , $ visible_start ).
634+ str_repeat ('* ' , $ stars_count ).
633635 substr ($ username , -$ visible_end );
634636 }
635637
636- return $ blurred_username . '@ ' . $ domain ;
638+ return $ blurred_username. '@ ' . $ domain ;
637639 }
638640}
0 commit comments