Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

MDL-30575 yet more mail header cleanup

  • Loading branch information...
commit 1501cc8cea9ecc316e354250cc9aed0894e3433f 1 parent a9e3abe
Petr Skoda skodak authored

Showing 1 changed file with 5 additions and 5 deletions. Show diff stats Hide diff stats

  1. +5 5 lib/phpmailer/class.phpmailer.php
10 lib/phpmailer/class.phpmailer.php
@@ -653,11 +653,11 @@ function AddrAppend($type, $addr) {
653 653 */
654 654 function AddrFormat($addr) {
655 655 if(empty($addr[1]))
656   - $formatted = $addr[0];
  656 + $formatted = preg_replace('/[\r\n]+/', '', $addr[0]); // Moodle modification
657 657 else
658 658 {
659   - $formatted = $this->EncodeHeader($addr[1], 'phrase') . " <" .
660   - $addr[0] . ">";
  659 + $formatted = $this->EncodeHeader($addr[1], 'phrase') . " <" .
  660 + preg_replace('/[\r\n]+/', '', $addr[0]) . ">"; // Moodle modification
661 661 }
662 662
663 663 return $formatted;
@@ -780,9 +780,9 @@ function CreateHeader() {
780 780
781 781 $result .= $this->HeaderLine("Date", $this->RFCDate());
782 782 if($this->Sender == "")
783   - $result .= $this->HeaderLine("Return-Path", trim($this->From));
  783 + $result .= $this->HeaderLine("Return-Path", trim(preg_replace('/[\r\n]+/', '', $this->From))); // Moodle modification
784 784 else
785   - $result .= $this->HeaderLine("Return-Path", trim($this->Sender));
  785 + $result .= $this->HeaderLine("Return-Path", trim(preg_replace('/[\r\n]+/', '', $this->Sender))); // Moodle modification
786 786
787 787 // To be created automatically by mail()
788 788 if($this->Mailer != "mail")

0 comments on commit 1501cc8

Please sign in to comment.
Something went wrong with that request. Please try again.