Fix #4347: use MailAddress object for reply-to
authorAntoine Musso <hashar@users.mediawiki.org>
Sat, 3 Feb 2007 22:55:01 +0000 (22:55 +0000)
committerAntoine Musso <hashar@users.mediawiki.org>
Sat, 3 Feb 2007 22:55:01 +0000 (22:55 +0000)
RELEASE-NOTES
includes/UserMailer.php

index 390ff47..744b288 100644 (file)
@@ -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 <ins> and <del> tags to emphase the differences
 * (bug 6684) Fix improper javascript array iteration
+* (bug 4347) use MailAddress object for reply-to
 
 
 == Languages updated ==
index fe08ae2..b2d1a4f 100644 (file)
@@ -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 ) ) {