r40107 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r40106‎ | r40107 | r40108 >
Date:21:12, 27 August 2008
Author:brion
Status:old
Tags:
Comment:
Revert r40042 "* In Article::replaceSection(), actually return null when $section is bogus. Used this in my half-complete and now kind of abandoned attempt at rewriting EditPage.php"

This causes regression bug 15340 -- null-edits to a section destroy the rest of the page.
Modified paths:
  • /trunk/phase3/includes/Article.php (modified) (history)
  • /trunk/phase3/includes/UserMailer.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Article.php
@@ -1288,9 +1288,6 @@
12891289 # Replacing an existing section; roll out the big guns
12901290 global $wgParser;
12911291 $text = $wgParser->replaceSection( $oldtext, $section, $text );
1292 - # If $section is bogus, replaceSection() will be a no-op
1293 - if($text == $oldtext)
1294 - return null;
12951292 }
12961293
12971294 }
Index: trunk/phase3/includes/UserMailer.php
@@ -98,10 +98,9 @@
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
103102 * @return mixed True on success, a WikiError object on failure.
104103 */
105 - static function send( $to, $from, $subject, $body, $replyto=null, $contentType=null ) {
 104+ static function send( $to, $from, $subject, $body, $replyto=null ) {
106105 global $wgSMTP, $wgOutputEncoding, $wgErrorString, $wgEnotifImpersonal;
107106 global $wgEnotifMaxRecips;
108107
@@ -140,12 +139,7 @@
141140 $headers['Subject'] = wfQuotedPrintable( $subject );
142141 $headers['Date'] = date( 'r' );
143142 $headers['MIME-Version'] = '1.0';
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;
 143+ $headers['Content-type'] = 'text/plain; charset='.$wgOutputEncoding;
150144 $headers['Content-transfer-encoding'] = '8bit';
151145 $headers['Message-ID'] = "<$msgid@" . $wgSMTP['IDHost'] . '>'; // FIXME
152146 $headers['X-Mailer'] = 'MediaWiki mailer';
@@ -176,11 +170,9 @@
177171 } else {
178172 $endl = "\n";
179173 }
180 - $ctype = (is_null($contentType) ?
181 - 'text/plain; charset='.$wgOutputEncoding : $contentType);
182174 $headers =
183175 "MIME-Version: 1.0$endl" .
184 - "Content-type: $ctype$endl" .
 176+ "Content-type: text/plain; charset={$wgOutputEncoding}$endl" .
185177 "Content-Transfer-Encoding: 8bit$endl" .
186178 "X-Mailer: MediaWiki mailer$endl".
187179 'From: ' . $from->toString();

Follow-up revisions

RevisionCommit summaryAuthorDate
r40108Revert part of r40107 (Revert r40042 because of regressions). The changes to ...catrope21:15, 27 August 2008

Past revisions this follows-up on

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