X-Git-Url: https://git.cyclocoop.org/%7B%24admin_url%7Dmembres/cotisations/rappels.php?a=blobdiff_plain;f=includes%2Fmail%2FUserMailer.php;h=464e7b8eee43adff57b70e537c2a1d4e07985512;hb=f9d7d3b8561dab3ddfd8798a77a5b72e03ac8c2b;hp=5343b2c7036247bc12493bdce92efd28dabeb165;hpb=7f4ae11049eabe4820699768dc29f7dc9481adcf;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/mail/UserMailer.php b/includes/mail/UserMailer.php index 5343b2c703..464e7b8eee 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 = [] ) { 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 = [ $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'; }