diff --git a/lib/phpmailer/class.phpmailer.php b/lib/phpmailer/class.phpmailer.php index 094f6be7e32..430cbc9ab81 100644 --- a/lib/phpmailer/class.phpmailer.php +++ b/lib/phpmailer/class.phpmailer.php @@ -1080,9 +1080,9 @@ class PHPMailer { $result .= $this->HeaderLine('Date', self::RFCDate()); if($this->Sender == '') { - $result .= $this->HeaderLine('Return-Path', trim($this->From)); + $result .= $this->HeaderLine('Return-Path', trim($this->SecureHeader($this->From))); // Moodle modification } else { - $result .= $this->HeaderLine('Return-Path', trim($this->Sender)); + $result .= $this->HeaderLine('Return-Path', trim($this->SecureHeader($this->Sender))); // Moodle modification } // To be created automatically by mail()