From 1767e83645eb3013c2d76448609b9689bb8055b1 Mon Sep 17 00:00:00 2001 From: Ortwin Pinke Date: Tue, 3 Sep 2024 16:01:48 +0200 Subject: [PATCH] recode form output, tested db entries and send mails, remove not needed tabindex --- includes/functions.custom.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/includes/functions.custom.php b/includes/functions.custom.php index 45e7da1..e806a88 100644 --- a/includes/functions.custom.php +++ b/includes/functions.custom.php @@ -123,16 +123,16 @@ function enwiSendMailSmtp(string $html, string $subject, array $recipients, arra if (isset($recipients[0]) && is_array($recipients[0])) { for ($i = 0, $n = count($recipients); $i < $n; $i ++) { if (strlen($recipients[$i]['email'])) { - $mail->AddAddress($recipients[$i]['email'], ((strlen($recipients[$i]['name'])) ? html_entity_decode($recipients[$i]['name'], ENT_QUOTES, $encoding) : $recipients[$i]['email'])); + $mail->AddAddress($recipients[$i]['email'], ((strlen($recipients[$i]['name']) > 0) ? html_entity_decode($recipients[$i]['name'], ENT_QUOTES, $encoding) : $recipients[$i]['email'])); } } } else { - $mail->AddAddress($recipients['email'], ((strlen($recipients['name'])) ? html_entity_decode($recipients['name'], ENT_QUOTES, $encoding) : $recipients['email'])); + $mail->AddAddress($recipients['email'], ((strlen($recipients['name']) > 0) ? html_entity_decode($recipients['name'], ENT_QUOTES, $encoding) : $recipients['email'])); } // set replyto if needed if(filter_var($fromEmail, FILTER_VALIDATE_EMAIL)) { - $fromName = (strlen($fromName) > 0)?$fromName:''; + $fromName = (strlen($fromName) > 0)?$fromName:$fromEmail; $mail->addReplyTo($fromEmail, $fromName); }