Replace semicolons with commas for multiple emails

merge-requests/11/head
Mike Koch 8 years ago
parent adbb1b9ee7
commit 047f36c92c

@ -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;

@ -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 */

@ -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'];

Loading…
Cancel
Save