Skip to content

Commit

Permalink
AdminEmail: be more relaxed on whitespace.
Browse files Browse the repository at this point in the history
  • Loading branch information
Traumflug committed Sep 9, 2019
1 parent 2a09714 commit 94a7e5e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions controllers/admin/AdminEmailsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -386,15 +386,18 @@ public function beforeUpdateOptions()
$this->errors[] = Tools::displayError('You must define an SMTP server and an SMTP port. If you do not know it, use the PHP mail() function instead.');
}

if (isset($_POST['TB_BCC_ALL_MAILS_TO']) && !empty($_POST['TB_BCC_ALL_MAILS_TO'])) {
if (isset($_POST['TB_BCC_ALL_MAILS_TO'])) {
$bccMails = explode(';', $_POST['TB_BCC_ALL_MAILS_TO']);

// Validate all emails
$bccMailsAreValid = true;
foreach ($bccMails as $index => $bccMail) {
// Make a cleanup for spaces and tabs
$bccMail = trim($bccMail);
if (Validate::isEmail($bccMail)) {
if ( ! $bccMail) {
// Empty string, double semicolons, whatever.
unset($bccMails[$index]);
} elseif (Validate::isEmail($bccMail)) {
$bccMails[$index] = $bccMail;
} else {
// There's no need to validate the remaining emails since we have at least one invalid email.
Expand Down

0 comments on commit 94a7e5e

Please sign in to comment.