Skip to content
This repository was archived by the owner on Mar 8, 2021. It is now read-only.

Commit 18a5873

Browse files
committed
Bug #9938: Send sendirect, ccsender and autotext mails only to the first mail address of the comma separated list.
1 parent 0d1af27 commit 18a5873

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

Diff for: assets/snippets/eform/docs/eform.htm

+1-1
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ <h3>Version 1.4.4.1 - 1.4.4.8</h3>
155155
<li>Work around for setting required class on check &amp; radio labels</li>
156156
<li>bugfix: If eform attibute is set on multiple check boxes only the last value is set in values list</li>
157157
<li>Security fix: Additional sanitization applied after stripslashes is used on fields</li>
158-
<li>Security fix: Send ccsender and autotext mails only to the first mail address of the comma separated list.</li>
158+
<li>Security fix: Send sendirect, ccsender and autotext mails only to the first mail address of the comma separated list.</li>
159159
</ul>
160160
<p><br />You can see a more extensive <a href="eform_history.htm">version history here</a>. </p>
161161
</div>

Diff for: assets/snippets/eform/docs/eform_history.htm

+1-1
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ <h3>Version 1.4.4.1 - 1.4.4.8</h3>
146146
<li>Work around for setting required class on check &amp; radio labels</li>
147147
<li>bugfix: If eform attibute is set on multiple check boxes only the last value is set in values list</li>
148148
<li>Security fix: Additional sanitization applied after stripslashes is used on fields</li>
149-
<li>Security fix: Send ccsender and autotext mails only to the first mail address of the comma separated list.</li>
149+
<li>Security fix: Send sendirect, ccsender and autotext mails only to the first mail address of the comma separated list.</li>
150150
</ul>
151151
<h3>Version 1.4.4</h3>
152152
<ul>

Diff for: assets/snippets/eform/eform.inc.php

+10-10
Original file line numberDiff line numberDiff line change
@@ -457,8 +457,15 @@ function eForm($modx,$params) {
457457
//defaults to html so only test sendasText
458458
$isHtml = ($sendAsText==1 || strstr($sendAsText,'report'))?false:true;
459459

460+
# added in 1.4.4.8 - Send sendirect, ccsender and autotext mails only to the first mail address of the comma separated list.
461+
if ($fields['email']) {
462+
$firstEmail = array_shift(explode(',', $fields['email']));
463+
} else {
464+
$firstEmail = '';
465+
}
466+
460467
if(!$noemail) {
461-
if($sendirect) $to = $fields['email'];
468+
if($sendirect) $to = $firstEmail;
462469
$mail = new PHPMailer();
463470
$mail->IsMail();
464471
$mail->CharSet = $modx->config['modx_charset'];
@@ -475,15 +482,8 @@ function eForm($modx,$params) {
475482
if(!$mail->send()) return 'Main mail: ' . $_lang['ef_mail_error'] . $mail->ErrorInfo;
476483
}
477484

478-
# added in 1.4.4.8 - Send ccsender and autotext mails only to the first mail address of the comma separated list.
479-
if ($fields['email']) {
480-
$firstEmail = array_shift(explode(',', $fields['email']));
481-
} else {
482-
$firstEmail = FALSE;
483-
}
484-
485485
# send user a copy of the report
486-
if($ccsender && $firstEmail) {
486+
if($ccsender && $firstEmail != '') {
487487
$mail = new PHPMailer();
488488
$mail->IsMail();
489489
$mail->CharSet = $modx->config['modx_charset'];
@@ -500,7 +500,7 @@ function eForm($modx,$params) {
500500
# send auto-respond email
501501
//defaults to html so only test sendasText
502502
$isHtml = ($sendAsText==1 || strstr($sendAsText,'autotext'))?false:true;
503-
if ($autotext && $firstEmail) {
503+
if ($autotext && $firstEmail != '') {
504504
$autotext = formMerge($autotext,$fields);
505505
$mail = new PHPMailer();
506506
$mail->IsMail();

0 commit comments

Comments
 (0)