r40108 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r40107‎ | r40108 | r40109 >
Date:21:15, 27 August 2008
Author:catrope
Status:old
Tags:
Comment:
Revert part of r40107 (Revert r40042 because of regressions). The changes to UserMailer.php had nothing to do with that bug.
Modified paths:
  • /trunk/phase3/includes/UserMailer.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/UserMailer.php
@@ -98,9 +98,10 @@
9999 * @param $subject String: email's subject.
100100 * @param $body String: email's text.
101101 * @param $replyto String: optional reply-to email (default: null).
 102+ * @param $contentType String: optional custom Content-Type
102103 * @return mixed True on success, a WikiError object on failure.
103104 */
104 - static function send( $to, $from, $subject, $body, $replyto=null ) {
 105+ static function send( $to, $from, $subject, $body, $replyto=null, $contentType=null ) {
105106 global $wgSMTP, $wgOutputEncoding, $wgErrorString, $wgEnotifImpersonal;
106107 global $wgEnotifMaxRecips;
107108
@@ -139,7 +140,12 @@
140141 $headers['Subject'] = wfQuotedPrintable( $subject );
141142 $headers['Date'] = date( 'r' );
142143 $headers['MIME-Version'] = '1.0';
143 - $headers['Content-type'] = 'text/plain; charset='.$wgOutputEncoding;
 144+ $headers['Content-type'] = (is_null($contentType) ?
 145+ 'text/plain; charset='.$wgOutputEncoding : $contentType);
 146+ if(is_null($contentType))
 147+ $headers['Content-type'] = 'text/plain; charset='.$wgOutputEncoding;
 148+ else
 149+ $headers['Content-type'] = $contentType;
144150 $headers['Content-transfer-encoding'] = '8bit';
145151 $headers['Message-ID'] = "<$msgid@" . $wgSMTP['IDHost'] . '>'; // FIXME
146152 $headers['X-Mailer'] = 'MediaWiki mailer';
@@ -170,9 +176,11 @@
171177 } else {
172178 $endl = "\n";
173179 }
 180+ $ctype = (is_null($contentType) ?
 181+ 'text/plain; charset='.$wgOutputEncoding : $contentType);
174182 $headers =
175183 "MIME-Version: 1.0$endl" .
176 - "Content-type: text/plain; charset={$wgOutputEncoding}$endl" .
 184+ "Content-type: $ctype$endl" .
177185 "Content-Transfer-Encoding: 8bit$endl" .
178186 "X-Mailer: MediaWiki mailer$endl".
179187 'From: ' . $from->toString();

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r40042* In Article::replaceSection(), actually return null when $section is bogus. ...catrope20:07, 26 August 2008
r40107Revert r40042 "* In Article::replaceSection(), actually return null when $sec...brion21:12, 27 August 2008