Permalink
Browse files

MDL-30575 yet more mail header cleanup

  • Loading branch information...
skodak committed Dec 11, 2011
1 parent a9e3abe commit 1501cc8cea9ecc316e354250cc9aed0894e3433f
Showing with 5 additions and 5 deletions.
  1. +5 −5 lib/phpmailer/class.phpmailer.php
@@ -653,11 +653,11 @@ function AddrAppend($type, $addr) {
*/
function AddrFormat($addr) {
if(empty($addr[1]))
- $formatted = $addr[0];
+ $formatted = preg_replace('/[\r\n]+/', '', $addr[0]); // Moodle modification
else
{
- $formatted = $this->EncodeHeader($addr[1], 'phrase') . " <" .
- $addr[0] . ">";
+ $formatted = $this->EncodeHeader($addr[1], 'phrase') . " <" .
+ preg_replace('/[\r\n]+/', '', $addr[0]) . ">"; // Moodle modification
}
return $formatted;
@@ -780,9 +780,9 @@ function CreateHeader() {
$result .= $this->HeaderLine("Date", $this->RFCDate());
if($this->Sender == "")
- $result .= $this->HeaderLine("Return-Path", trim($this->From));
+ $result .= $this->HeaderLine("Return-Path", trim(preg_replace('/[\r\n]+/', '', $this->From))); // Moodle modification
else
- $result .= $this->HeaderLine("Return-Path", trim($this->Sender));
+ $result .= $this->HeaderLine("Return-Path", trim(preg_replace('/[\r\n]+/', '', $this->Sender))); // Moodle modification
// To be created automatically by mail()
if($this->Mailer != "mail")

0 comments on commit 1501cc8

Please sign in to comment.