Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
use getsystemvalue-functions in Mailer.php
Signed-off-by: Simon L <[email protected]>
  • Loading branch information
szaimen committed Jun 23, 2023
commit 76bedb884318ebd37031a2aa696c7bee8827db2c
8 changes: 4 additions & 4 deletions lib/private/Mail/Mailer.php
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ protected function getSmtpInstance(): EsmtpTransport {
// either null or true - if nothing is passed, let the symfony mailer figure out the configuration by itself
$mailSmtpsecure = ($this->config->getSystemValue('mail_smtpsecure', null) === 'ssl') ? true : null;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe?

Suggested change
$mailSmtpsecure = ($this->config->getSystemValue('mail_smtpsecure', null) === 'ssl') ? true : null;
$mailSmtpsecure = ($this->config->getSystemValueString('mail_smtpsecure', '') === 'ssl') ? true : null;

$transport = new EsmtpTransport(
$this->config->getSystemValue('mail_smtphost', '127.0.0.1'),
$this->config->getSystemValueString('mail_smtphost', '127.0.0.1'),
$this->config->getSystemValueInt('mail_smtpport', 25),
$mailSmtpsecure,
null,
Expand All @@ -301,11 +301,11 @@ protected function getSmtpInstance(): EsmtpTransport {
/** @var SocketStream $stream */
$stream = $transport->getStream();
/** @psalm-suppress InternalMethod */
$stream->setTimeout($this->config->getSystemValue('mail_smtptimeout', 10));
$stream->setTimeout($this->config->getSystemValueInt('mail_smtptimeout', 10));

if ($this->config->getSystemValueBool('mail_smtpauth', false)) {
$transport->setUsername($this->config->getSystemValue('mail_smtpname', ''));
$transport->setPassword($this->config->getSystemValue('mail_smtppassword', ''));
$transport->setUsername($this->config->getSystemValueString('mail_smtpname', ''));
$transport->setPassword($this->config->getSystemValueString('mail_smtppassword', ''));
}

$streamingOptions = $this->config->getSystemValue('mail_smtpstreamoptions', []);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe?

Suggested change
$streamingOptions = $this->config->getSystemValue('mail_smtpstreamoptions', []);
$streamingOptions = (array)$this->config->getSystemValue('mail_smtpstreamoptions', []);

Expand Down