Skip to content

Commit cd2cdf6

Browse files
author
mrflos
committed
fix(contact): retrocomp for send_mail not to an array
1 parent ab91ade commit cd2cdf6

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

includes/email.inc.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,11 @@ function send_mail($mail_sender, $name_sender, $mail_receiver, $subject, $messag
8686
}
8787
}
8888

89+
// for retro-compatibility, if $mail_receiver is not an array, we convert it
90+
if (!is_array($mail_receiver) && filter_var($mail_receiver, FILTER_VALIDATE_EMAIL)) {
91+
$mail_receiver[] = $mail_receiver;
92+
}
93+
8994
$recipientBatches = array_chunk($mail_receiver, $batchSize);
9095

9196
foreach ($recipientBatches as $batchIndex => $batch) {

0 commit comments

Comments
 (0)