Skip to content

Commit

Permalink
Do not send the smtppass on test if field is disabled (#31724)
Browse files Browse the repository at this point in the history
  • Loading branch information
HLeithner authored Dec 22, 2020
1 parent 12830b3 commit 62ad030
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion media/system/js/sendtestmail-uncompressed.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ var sendTestMail = function ()
var email_data = {
smtpauth : $('input[name="jform[smtpauth]"]:checked').val(),
smtpuser : $('input[name="jform[smtpuser]"]').val(),
smtppass : $('input[name="jform[smtppass]"]').val(),
smtphost : $('input[name="jform[smtphost]"]').val(),
smtpsecure: $('select[name="jform[smtpsecure]"]').val(),
smtpport : $('input[name="jform[smtpport]"]').val(),
Expand All @@ -24,6 +23,12 @@ var sendTestMail = function ()
mailonline: $('input[name="jform[mailonline]"]:checked').val()
};

var $smtppass = $('input[name="jform[smtppass]"]');

if ($smtppass.is(':disabled') === false) {
email_data.smtppass = $smtppass.val();
}

// Remove js messages, if they exist.
Joomla.removeMessages();

Expand Down
2 changes: 1 addition & 1 deletion media/system/js/sendtestmail.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 62ad030

Please sign in to comment.