X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FUserMailer.php;h=0d771593e349bd326f704e646bf112880b4d57e6;hb=af94bc9c69db033c7308192b42a47a4f27e25878;hp=e48070aa04c6755d4e322bf8eeea1d6d8add0b05;hpb=c8b2ad0c98ad36908b329ca1d8f408dec86bbf31;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/UserMailer.php b/includes/UserMailer.php index e48070aa04..0d771593e3 100644 --- a/includes/UserMailer.php +++ b/includes/UserMailer.php @@ -241,7 +241,7 @@ class UserMailer { $headers['Reply-To'] = $replyto->toString(); } - $headers['Date'] = date( 'r' ); + $headers['Date'] = MWTimestamp::getLocalInstance()->format( 'r' ); $headers['Message-ID'] = self::makeMsgId(); $headers['X-Mailer'] = 'MediaWiki mailer'; @@ -258,6 +258,8 @@ class UserMailer { wfDebug( "Assembling multipart mime email\n" ); if ( !stream_resolve_include_path( 'Mail/mime.php' ) ) { wfDebug( "PEAR Mail_Mime package is not installed. Falling back to text email.\n" ); + // remove the html body for text email fall back + $body = $body['text']; } else { require_once 'Mail/mime.php'; @@ -265,7 +267,7 @@ class UserMailer { $body['text'] = str_replace( "\n", "\r\n", $body['text'] ); $body['html'] = str_replace( "\n", "\r\n", $body['html'] ); } - $mime = new Mail_mime( array( 'eol' => $endl ) ); + $mime = new Mail_mime( array( 'eol' => $endl, 'text_charset' => 'UTF-8', 'html_charset' => 'UTF-8' ) ); $mime->setTXTBody( $body['text'] ); $mime->setHTMLBody( $body['html'] ); $body = $mime->get(); // must call get() before headers() @@ -668,11 +670,13 @@ class EmailNotification { } elseif ( $targetUser->getOption( 'enotifusertalkpages' ) && ( !$minorEdit || $targetUser->getOption( 'enotifminoredits' ) ) ) { - if ( $targetUser->isEmailConfirmed() ) { + if ( !$targetUser->isEmailConfirmed() ) { + wfDebug( __METHOD__ . ": talk page owner doesn't have validated email\n" ); + } elseif ( !wfRunHooks( 'AbortTalkPageEmailNotification', array( $targetUser, $title ) ) ) { + wfDebug( __METHOD__ . ": talk page update notification is aborted for this user\n" ); + } else { wfDebug( __METHOD__ . ": sending talk page update notification\n" ); return true; - } else { - wfDebug( __METHOD__ . ": talk page owner doesn't have validated email\n" ); } } else { wfDebug( __METHOD__ . ": talk page owner doesn't want notifications\n" );