From d70660f2dc34e289ee0dc7005520a2eb83d4a06f Mon Sep 17 00:00:00 2001 From: Reedy Date: Thu, 21 Jan 2016 01:11:53 +0000 Subject: [PATCH] Fixup contenttype stuff in UserMailer Change-Id: I9e251962fe731fa78f6867a14e2e91783288dd61 --- includes/mail/UserMailer.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/includes/mail/UserMailer.php b/includes/mail/UserMailer.php index 85595f1286..ded5dec100 100644 --- a/includes/mail/UserMailer.php +++ b/includes/mail/UserMailer.php @@ -116,7 +116,7 @@ class UserMailer { */ public static function send( $to, $from, $subject, $body, $options = array() ) { global $wgAllowHTMLEmail; - $contentType = 'text/plain; charset=UTF-8'; + if ( !is_array( $options ) ) { // Old calling style wfDeprecated( __METHOD__ . ' with $replyto as 5th parameter', '1.26' ); @@ -125,6 +125,9 @@ class UserMailer { $options['contentType'] = func_get_arg( 5 ); } } + if ( !isset( $options['contentType'] ) ) { + $options['contentType'] = 'text/plain; charset=UTF-8'; + } if ( !is_array( $to ) ) { $to = array( $to ); @@ -327,8 +330,7 @@ class UserMailer { $body = str_replace( "\n", "\r\n", $body ); } $headers['MIME-Version'] = '1.0'; - $headers['Content-type'] = ( is_null( $contentType ) ? - 'text/plain; charset=UTF-8' : $contentType ); + $headers['Content-type'] = $contentType; $headers['Content-transfer-encoding'] = '8bit'; } -- 2.20.1