From: Reedy Date: Thu, 21 Jan 2016 01:11:53 +0000 (+0000) Subject: Fixup contenttype stuff in UserMailer X-Git-Tag: 1.31.0-rc.0~7832^2 X-Git-Url: http://git.cyclocoop.org///%22%40url%40//%22?a=commitdiff_plain;h=d70660f2dc34e289ee0dc7005520a2eb83d4a06f;p=lhc%2Fweb%2Fwiklou.git Fixup contenttype stuff in UserMailer Change-Id: I9e251962fe731fa78f6867a14e2e91783288dd61 --- 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'; }