Skip to content

Commit

Permalink
phpmailer: adding replyTo-Adresses to log (#5425)
Browse files Browse the repository at this point in the history
Co-authored-by: Gregor Harlan <330436+gharlan@users.noreply.github.com>
  • Loading branch information
skerbis and gharlan committed Dec 30, 2022
1 parent e67e7c9 commit cc70617
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
3 changes: 2 additions & 1 deletion .tools/psalm/baseline.xml
Expand Up @@ -2001,7 +2001,8 @@
<code>$this-&gt;xHeader[$kind]</code>
<code>$this-&gt;xHeader['to']</code>
</MixedArgument>
<MixedArgumentTypeCoercion occurrences="1">
<MixedArgumentTypeCoercion occurrences="2">
<code>array_column($this-&gt;getReplyToAddresses(), 0)</code>
<code>array_column($this-&gt;getToAddresses(), 0)</code>
</MixedArgumentTypeCoercion>
<MixedArrayOffset occurrences="1">
Expand Down
7 changes: 6 additions & 1 deletion redaxo/src/addons/phpmailer/lib/mailer.php
Expand Up @@ -170,10 +170,15 @@ public function clearAllRecipients()

private function log(string $success): void
{
$replytos = '';
if (count($this->getReplyToAddresses()) > 0) {
$replytos = implode(', ', array_column($this->getReplyToAddresses(), 0));
}

$log = new rex_log_file(self::logFile(), 2000000);
$data = [
$success,
$this->From,
$this->From.($replytos ? '; reply-to: '.$replytos : ''),
implode(', ', array_column($this->getToAddresses(), 0)),
$this->Subject,
trim(str_replace('https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting', '', strip_tags($this->ErrorInfo))),
Expand Down

0 comments on commit cc70617

Please sign in to comment.