From 2b5f7032ec8f4563181c4b2f8542da839cad9647 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Wed, 27 Aug 2008 21:12:44 +0000 Subject: [PATCH] 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. --- includes/Article.php | 3 --- includes/UserMailer.php | 14 +++----------- 2 files changed, 3 insertions(+), 14 deletions(-) diff --git a/includes/Article.php b/includes/Article.php index aef565cb0f..560c1d3067 100644 --- a/includes/Article.php +++ b/includes/Article.php @@ -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; } } diff --git a/includes/UserMailer.php b/includes/UserMailer.php index 436b1e48b5..ad550dc3b4 100644 --- a/includes/UserMailer.php +++ b/includes/UserMailer.php @@ -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(); -- 2.20.1