r95547 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r95546‎ | r95547 | r95548 >
Date:00:01, 26 August 2011
Author:dantman
Status:resolved (Comments)
Tags:
Comment:
Followup r93417; Don't use $wgServer in a way that makes invalid Message-IDs. Instead use IDHost if set, otherwise extract the host from $wgServer. Also instead of a static UserMailer prefix use the wiki's id.
Modified paths:
  • /trunk/phase3/includes/UserMailer.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/UserMailer.php
@@ -127,10 +127,16 @@
128128 * @return String
129129 */
130130 static function makeMsgId() {
131 - global $wgServer;
 131+ global $wgSMTP, $wgServer;
132132
133 - $msgid = uniqid( "UserMailer", true ); /* true required for cygwin */
134 - return "<$msgid@$wgServer>";
 133+ $msgid = uniqid( wfWikiID() . ".", true ); /* true required for cygwin */
 134+ if ( is_array($wgSMTP) && $isset($wgSMTP['IDHost']) && $wgSMTP['IDHost'] ) {
 135+ $domain = $wgSMTP['IDHost'];
 136+ } else {
 137+ $url = wfParseUrl($wgServer);
 138+ $domain = $url['host'];
 139+ }
 140+ return "<$msgid@$domain>";
135141 }
136142
137143 /**

Sign-offs

UserFlagDate
Nikerabbitinspected09:40, 26 August 2011

Follow-up revisions

RevisionCommit summaryAuthorDate
r95682Followup r95547; Where'd that $ come from?dantman18:53, 29 August 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r93417follow up r93397 — missed msgidmah19:38, 28 July 2011

Comments

#Comment by Brion VIBBER (talk | contribs)   18:11, 29 August 2011
#Comment by Dantman (talk | contribs)   18:55, 29 August 2011

Ugh, I don't know how that $ got there... and here I even tested this commit...

Should be fixed with r95682.

Status & tagging log