r19746 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r19745‎ | r19746 | r19747 >
Date:22:55, 3 February 2007
Author:hashar
Status:old
Tags:
Comment:
Fix #4347: use MailAddress object for reply-to
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/UserMailer.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/UserMailer.php
@@ -77,9 +77,9 @@
7878 * @param $from MailAddress: sender's email
7979 * @param $subject String: email's subject.
8080 * @param $body String: email's text.
81 - * @param $replyto String: optional reply-to email (default: false).
 81+ * @param $replyto String: optional reply-to email (default: null).
8282 */
83 -function userMailer( $to, $from, $subject, $body, $replyto=false ) {
 83+function userMailer( $to, $from, $subject, $body, $replyto=null ) {
8484 global $wgUser, $wgSMTP, $wgOutputEncoding, $wgErrorString;
8585
8686 if (is_array( $wgSMTP )) {
@@ -91,7 +91,7 @@
9292 $headers['From'] = $from->toString();
9393 $headers['To'] = $to->toString();
9494 if ( $replyto ) {
95 - $headers['Reply-To'] = $replyto;
 95+ $headers['Reply-To'] = $replyto->toString();
9696 }
9797 $headers['Subject'] = wfQuotedPrintable( $subject );
9898 $headers['Date'] = date( 'r' );
@@ -140,7 +140,7 @@
141141 "X-Mailer: MediaWiki mailer$endl".
142142 'From: ' . $from->toString();
143143 if ($replyto) {
144 - $headers .= "{$endl}Reply-To: $replyto";
 144+ $headers .= "{$endl}Reply-To: " . $replyto->toString();
145145 }
146146
147147 $dest = $to->toString();
@@ -368,7 +368,7 @@
369369 }
370370 } else {
371371 $from = $adminAddress;
372 - $replyto = $wgNoReplyAddress;
 372+ $replyto = new MailAddress( $wgNoReplyAddress );
373373 }
374374
375375 if( $wgUser->isIP( $name ) ) {
Index: trunk/phase3/RELEASE-NOTES
@@ -170,6 +170,7 @@
171171 * (bug 8789) AJAX search: IE users can now use the return key
172172 * (bug 6844) Use <ins> and <del> tags to emphase the differences
173173 * (bug 6684) Fix improper javascript array iteration
 174+* (bug 4347) use MailAddress object for reply-to
174175
175176
176177 == Languages updated ==