X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=includes%2Fmail%2FUserMailer.php;h=102d61599ca8ca663214ba855a4527b2da48c2fb;hp=7b48ad095a8e0d28c4831458bd16328361859160;hb=c57aacb782f5ce5e53253192a53d736ece300d3c;hpb=478a58f63101f2b47d18a618296b5e7970fa3f24 diff --git a/includes/mail/UserMailer.php b/includes/mail/UserMailer.php index 7b48ad095a..102d61599c 100644 --- a/includes/mail/UserMailer.php +++ b/includes/mail/UserMailer.php @@ -198,14 +198,8 @@ class UserMailer { private static function isMailMimeUsable() { static $usable = null; if ( $usable === null ) { - // If the class is not already loaded, and it's in the include path, - // try requiring it. - if ( !class_exists( 'Mail_mime' ) && stream_resolve_include_path( 'Mail/mime.php' ) ) { - require_once 'Mail/mime.php'; - } $usable = class_exists( 'Mail_mime' ); } - return $usable; } @@ -218,11 +212,6 @@ class UserMailer { private static function isMailUsable() { static $usable = null; if ( $usable === null ) { - // If the class is not already loaded, and it's in the include path, - // try requiring it. - if ( !class_exists( 'Mail' ) && stream_resolve_include_path( 'Mail.php' ) ) { - require_once 'Mail.php'; - } $usable = class_exists( 'Mail' ); } @@ -255,10 +244,9 @@ class UserMailer { global $wgSMTP, $wgEnotifMaxRecips, $wgAdditionalMailParams; $mime = null; - $replyto = isset( $options['replyTo'] ) ? $options['replyTo'] : null; - $contentType = isset( $options['contentType'] ) ? - $options['contentType'] : 'text/plain; charset=UTF-8'; - $headers = isset( $options['headers'] ) ? $options['headers'] : []; + $replyto = $options['replyTo'] ?? null; + $contentType = $options['contentType'] ?? 'text/plain; charset=UTF-8'; + $headers = $options['headers'] ?? []; // Allow transformation of content, such as encrypting/signing $error = false; @@ -396,7 +384,7 @@ class UserMailer { Wikimedia\suppressWarnings(); // Create the mail object using the Mail::factory method - $mail_object =& Mail::factory( 'smtp', $wgSMTP ); + $mail_object = Mail::factory( 'smtp', $wgSMTP ); if ( PEAR::isError( $mail_object ) ) { wfDebug( "PEAR::Mail factory failed: " . $mail_object->getMessage() . "\n" ); Wikimedia\restoreWarnings(); @@ -442,7 +430,7 @@ class UserMailer { try { foreach ( $to as $recip ) { $sent = mail( - $recip, + $recip->toString(), self::quotedPrintable( $subject ), $body, $headers,