Skip to content
Snippets Groups Projects
Commit c5e3ecf0 authored by Alexei Rayu's avatar Alexei Rayu Committed by Jason Flatt
Browse files

Issue #2879349 by alexrayu, oadaeh: Password never being saved if once hidden

parent 7393350f
No related branches found
No related tags found
No related merge requests found
...@@ -320,8 +320,8 @@ class SettingsForm extends ConfigFormBase { ...@@ -320,8 +320,8 @@ class SettingsForm extends ConfigFormBase {
->set('smtp_debug', $values['smtp_debug']) ->set('smtp_debug', $values['smtp_debug'])
->set('smtp_debug_log', $values['smtp_debug_log']); ->set('smtp_debug_log', $values['smtp_debug_log']);
// Ignore empty passwords, if hide password is active. // Only save the password, if it is not empty.
if ($phpmailer_config->get('smtp_hide_password') == 1 && $values['smtp_password'] != '') { if (!empty($values['smtp_password'])) {
$phpmailer_config->set('smtp_password', $values['smtp_password']); $phpmailer_config->set('smtp_password', $values['smtp_password']);
} }
......
...@@ -89,7 +89,7 @@ class DrupalPHPMailer extends PHPMailer implements MailInterface { ...@@ -89,7 +89,7 @@ class DrupalPHPMailer extends PHPMailer implements MailInterface {
// Use SMTP authentication if both username and password are given. // Use SMTP authentication if both username and password are given.
$this->Username = $module_config->get('smtp_username', ''); $this->Username = $module_config->get('smtp_username', '');
$this->Password = $module_config->get('smtp_password', ''); $this->Password = $module_config->get('smtp_password', '');
$this->SMTPAuth = (bool)($this->Username != '' && $this->Password != ''); $this->SMTPAuth = (bool) ($this->Username != '' && $this->Password != '');
$this->SMTPKeepAlive = $module_config->get('smtp_keepalive', 0); $this->SMTPKeepAlive = $module_config->get('smtp_keepalive', 0);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment