Fixup contenttype stuff in UserMailer
authorReedy <reedy@wikimedia.org>
Thu, 21 Jan 2016 01:11:53 +0000 (01:11 +0000)
committerReedy <reedy@wikimedia.org>
Thu, 21 Jan 2016 01:11:53 +0000 (01:11 +0000)
Change-Id: I9e251962fe731fa78f6867a14e2e91783288dd61

includes/mail/UserMailer.php

index 85595f1..ded5dec 100644 (file)
@@ -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';
                }