r14676 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r14675‎ | r14676 | r14677 >
Date:08:24, 9 June 2006
Author:brion
Status:old
Tags:
Comment:
* (bug 6243) Fix email for usernames containing dots when using PEAR::Mail
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/SpecialConfirmemail.php (modified) (history)
  • /trunk/phase3/includes/UserMailer.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/UserMailer.php
@@ -54,7 +54,11 @@
5555 */
5656 function toString() {
5757 if( $this->name != '' ) {
58 - return wfQuotedPrintable( $this->name ) . " <" . $this->address . ">";
 58+ $quoted = wfQuotedPrintable( $this->name );
 59+ if( strpos( $quoted, '.' ) !== false ) {
 60+ $quoted = '"' . $quoted . '"';
 61+ }
 62+ return "$quoted <{$this->address}>";
5963 } else {
6064 return $this->address;
6165 }
@@ -80,10 +84,10 @@
8185 require_once( 'Mail.php' );
8286
8387 $timestamp = time();
84 - $dest = $to->toString();
 88+ $dest = $to->address;
8589
8690 $headers['From'] = $from->toString();
87 - $headers['To'] = $dest;
 91+ $headers['To'] = $to->toString();
8892 if ( $replyto ) {
8993 $headers['Reply-To'] = $replyto;
9094 }
@@ -97,7 +101,7 @@
98102
99103 // Create the mail object using the Mail::factory method
100104 $mail_object =& Mail::factory('smtp', $wgSMTP);
101 - wfDebug( "Sending mail via PEAR::Mail to $dest" );
 105+ wfDebug( "Sending mail via PEAR::Mail to $dest\n" );
102106 $mailResult =& $mail_object->send($dest, $headers, $body);
103107
104108 # Based on the result return an error string,
Index: trunk/phase3/includes/SpecialConfirmemail.php
@@ -49,7 +49,8 @@
5050 function showRequestForm() {
5151 global $wgOut, $wgUser, $wgLang, $wgRequest;
5252 if( $wgRequest->wasPosted() && $wgUser->matchEditToken( $wgRequest->getText( 'token' ) ) ) {
53 - $message = $wgUser->sendConfirmationMail() ? 'confirmemail_sent' : 'confirmemail_sendfailed';
 53+ $ok = $wgUser->sendConfirmationMail();
 54+ $message = WikiError::isError( $ok ) ? 'confirmemail_sendfailed' : 'confirmemail_sent';
5455 $wgOut->addWikiText( wfMsg( $message ) );
5556 } else {
5657 if( $wgUser->isEmailConfirmed() ) {
Index: trunk/phase3/RELEASE-NOTES
@@ -461,7 +461,9 @@
462462 * (bug 5981) Add plural function Slovenian (sl)
463463 * (bug 5945) Introduce {{CONTENTLANGUAGE}} magic word
464464 * {{PLURAL}} can now take up to five forms
 465+* (bug 6243) Fix email for usernames containing dots when using PEAR::Mail
465466
 467+
466468 == Compatibility ==
467469
468470 MediaWiki 1.7 requires PHP 5 (5.1 recommended). PHP 4 is no longer supported.

Status & tagging log