Revert r40042 "* In Article::replaceSection(), actually return null when $section...
authorBrion Vibber <brion@users.mediawiki.org>
Wed, 27 Aug 2008 21:12:44 +0000 (21:12 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Wed, 27 Aug 2008 21:12:44 +0000 (21:12 +0000)
This causes regression bug 15340 -- null-edits to a section destroy the rest of the page.

includes/Article.php
includes/UserMailer.php

index aef565c..560c1d3 100644 (file)
@@ -1288,9 +1288,6 @@ class Article {
                                # Replacing an existing section; roll out the big guns
                                global $wgParser;
                                $text = $wgParser->replaceSection( $oldtext, $section, $text );
-                               # If $section is bogus, replaceSection() will be a no-op
-                               if($text == $oldtext)
-                                       return null;
                        }
 
                }
index 436b1e4..ad550dc 100644 (file)
@@ -98,10 +98,9 @@ class UserMailer {
         * @param $subject String: email's subject.
         * @param $body String: email's text.
         * @param $replyto String: optional reply-to email (default: null).
-        * @param $contentType String: optional custom Content-Type
         * @return mixed True on success, a WikiError object on failure.
         */
-       static function send( $to, $from, $subject, $body, $replyto=null, $contentType=null ) {
+       static function send( $to, $from, $subject, $body, $replyto=null ) {
                global $wgSMTP, $wgOutputEncoding, $wgErrorString, $wgEnotifImpersonal;
                global $wgEnotifMaxRecips;
 
@@ -140,12 +139,7 @@ class UserMailer {
                        $headers['Subject'] = wfQuotedPrintable( $subject );
                        $headers['Date'] = date( 'r' );
                        $headers['MIME-Version'] = '1.0';
-                       $headers['Content-type'] = (is_null($contentType) ?
-                                       'text/plain; charset='.$wgOutputEncoding : $contentType);
-                       if(is_null($contentType))
-                               $headers['Content-type'] = 'text/plain; charset='.$wgOutputEncoding;
-                       else
-                               $headers['Content-type'] = $contentType;
+                       $headers['Content-type'] = 'text/plain; charset='.$wgOutputEncoding;
                        $headers['Content-transfer-encoding'] = '8bit';
                        $headers['Message-ID'] = "<$msgid@" . $wgSMTP['IDHost'] . '>'; // FIXME
                        $headers['X-Mailer'] = 'MediaWiki mailer';
@@ -176,11 +170,9 @@ class UserMailer {
                        } else {
                                $endl = "\n";
                        }
-                       $ctype = (is_null($contentType) ? 
-                                       'text/plain; charset='.$wgOutputEncoding : $contentType);
                        $headers =
                                "MIME-Version: 1.0$endl" .
-                               "Content-type: $ctype$endl" .
+                               "Content-type: text/plain; charset={$wgOutputEncoding}$endl" .
                                "Content-Transfer-Encoding: 8bit$endl" .
                                "X-Mailer: MediaWiki mailer$endl".
                                'From: ' . $from->toString();