From 520598e6e5adaecd30a7c5fd2c219b863fa203f9 Mon Sep 17 00:00:00 2001 From: Antoine Musso Date: Sat, 3 Feb 2007 22:55:01 +0000 Subject: [PATCH] Fix #4347: use MailAddress object for reply-to --- RELEASE-NOTES | 1 + includes/UserMailer.php | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 390ff47d3d..744b2882ad 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -170,6 +170,7 @@ lighter making things easier to read. * (bug 8789) AJAX search: IE users can now use the return key * (bug 6844) Use and tags to emphase the differences * (bug 6684) Fix improper javascript array iteration +* (bug 4347) use MailAddress object for reply-to == Languages updated == diff --git a/includes/UserMailer.php b/includes/UserMailer.php index fe08ae2034..b2d1a4f423 100644 --- a/includes/UserMailer.php +++ b/includes/UserMailer.php @@ -77,9 +77,9 @@ class MailAddress { * @param $from MailAddress: sender's email * @param $subject String: email's subject. * @param $body String: email's text. - * @param $replyto String: optional reply-to email (default: false). + * @param $replyto String: optional reply-to email (default: null). */ -function userMailer( $to, $from, $subject, $body, $replyto=false ) { +function userMailer( $to, $from, $subject, $body, $replyto=null ) { global $wgUser, $wgSMTP, $wgOutputEncoding, $wgErrorString; if (is_array( $wgSMTP )) { @@ -91,7 +91,7 @@ function userMailer( $to, $from, $subject, $body, $replyto=false ) { $headers['From'] = $from->toString(); $headers['To'] = $to->toString(); if ( $replyto ) { - $headers['Reply-To'] = $replyto; + $headers['Reply-To'] = $replyto->toString(); } $headers['Subject'] = wfQuotedPrintable( $subject ); $headers['Date'] = date( 'r' ); @@ -140,7 +140,7 @@ function userMailer( $to, $from, $subject, $body, $replyto=false ) { "X-Mailer: MediaWiki mailer$endl". 'From: ' . $from->toString(); if ($replyto) { - $headers .= "{$endl}Reply-To: $replyto"; + $headers .= "{$endl}Reply-To: " . $replyto->toString(); } $dest = $to->toString(); @@ -368,7 +368,7 @@ class EmailNotification { } } else { $from = $adminAddress; - $replyto = $wgNoReplyAddress; + $replyto = new MailAddress( $wgNoReplyAddress ); } if( $wgUser->isIP( $name ) ) { -- 2.20.1