Skip to content

Commit e59b14f

Browse files
committed
Allow both comma and semicolon to be valid seperators for $emails to be in sync with phpmail_send() function
1 parent 9d11e72 commit e59b14f

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

application/helpers/mailer_helper.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -212,18 +212,15 @@ function email_quote_status(string $quote_id, $status)
212212
/**
213213
* Validate email address syntax
214214
* $email string can be a single email or a list of emails.
215-
* The emails list must be comma separated.
215+
* The emails can either be comma (,) or semicolon (;) separated.
216216
*
217217
* @param string $email
218218
*
219219
* @return bool returs true if all emails are valid otherwise false
220220
*/
221221
function validate_email_address(string $email): bool
222222
{
223-
$emails[] = $email;
224-
if (str_contains($email, ',')) {
225-
$emails = explode(',', $email);
226-
}
223+
$emails = (mb_strpos($email, ',')) ? explode(',', $email) : explode(';', $email);
227224

228225
foreach ($emails as $emailItem) {
229226
if ( ! filter_var($emailItem, FILTER_VALIDATE_EMAIL)) {

0 commit comments

Comments
 (0)