diff --git a/admin/admin_submit_ticket.php b/admin/admin_submit_ticket.php index 0dac720b..d4464b1f 100644 --- a/admin/admin_submit_ticket.php +++ b/admin/admin_submit_ticket.php @@ -63,6 +63,9 @@ if ($hesk_settings['can_sel_lang']) { } $tmpvar['name'] = hesk_input(hesk_POST('name')) or $hesk_error_buffer['name'] = $hesklang['enter_your_name']; $tmpvar['email'] = hesk_POST('email'); +if ($hesk_settings['multi_eml']) { + $tmpvar['email'] = str_replace(';',',', $tmpvar['email']); +} $tmpvar['category'] = intval(hesk_POST('category')) or $hesk_error_buffer['category'] = $hesklang['sel_app_cat']; $tmpvar['priority'] = hesk_POST('priority'); $tmpvar['priority'] = strlen($tmpvar['priority']) ? intval($tmpvar['priority']) : -1; diff --git a/inc/common.inc.php b/inc/common.inc.php index cbb0f230..acf69a38 100644 --- a/inc/common.inc.php +++ b/inc/common.inc.php @@ -304,6 +304,7 @@ function hesk_verifyEmailMatch($trackingID, $my_email = 0, $ticket_email = 0, $e /* Validate email */ if ($hesk_settings['multi_eml']) { + $ticket_email = str_replace(';', ',', $ticket_email); $valid_emails = explode(',', strtolower($ticket_email)); if (in_array(strtolower($my_email), $valid_emails)) { /* Match, clean brute force attempts and return true */ diff --git a/submit_ticket.php b/submit_ticket.php index 22363010..fb9e18af 100644 --- a/submit_ticket.php +++ b/submit_ticket.php @@ -158,8 +158,13 @@ if ($hesk_settings['confirm_email']) { // Anything entered as email confirmation? if (strlen($tmpvar['email2'])) { // Do we have multiple emails? - if ($hesk_settings['multi_eml'] && count(array_diff(explode(',', strtolower($tmpvar['email'])), explode(',', strtolower($tmpvar['email2'])))) == 0) { - $_SESSION['c_email2'] = $_POST['email2']; + if ($hesk_settings['multi_eml']) { + $tmpvar['email'] = str_replace(';', ',', $tmpvar['email']); + $tmpvar['email2'] = str_replace(';', ',', $tmpvar['email2']); + + if (count(array_diff(explode(',', strtolower($tmpvar['email'])), explode(',', strtolower($tmpvar['email2'])))) == 0) { + $_SESSION['c_email2'] = $_POST['email2']; + } } // Single email address match elseif (!$hesk_settings['multi_eml'] && strtolower($tmpvar['email']) == strtolower($tmpvar['email2'])) { $_SESSION['c_email2'] = $_POST['email2'];