From d81f562b712f2387fa02290bf2ca86392ab356f2 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Wed, 11 Oct 2006 20:21:25 +0000 Subject: Aktualisierung auf Version 1.8.1 --- includes/UserMailer.php | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'includes/UserMailer.php') diff --git a/includes/UserMailer.php b/includes/UserMailer.php index 8de39a64..78a8be91 100644 --- a/includes/UserMailer.php +++ b/includes/UserMailer.php @@ -53,7 +53,10 @@ class MailAddress { * @return string */ function toString() { - if( $this->name != '' ) { + # PHP's mail() implementation under Windows is somewhat shite, and + # can't handle "Joe Bloggs " format email addresses, + # so don't bother generating them + if( $this->name != '' && !wfIsWindows() ) { $quoted = wfQuotedPrintable( $this->name ); if( strpos( $quoted, '.' ) !== false ) { $quoted = '"' . $quoted . '"'; @@ -101,6 +104,11 @@ function userMailer( $to, $from, $subject, $body, $replyto=false ) { // Create the mail object using the Mail::factory method $mail_object =& Mail::factory('smtp', $wgSMTP); + if( PEAR::isError( $mail_object ) ) { + wfDebug( "PEAR::Mail factory failed: " . $mail_object->getMessage() . "\n" ); + return $mail_object->getMessage(); + } + wfDebug( "Sending mail via PEAR::Mail to $dest\n" ); $mailResult =& $mail_object->send($dest, $headers, $body); @@ -258,8 +266,11 @@ class EmailNotification { $wuser = $dbr->fetchObject( $res ); $watchingUser->setID($wuser->wl_user); + if ( ( $enotifwatchlistpage && $watchingUser->getOption('enotifwatchlistpages') ) || - ( $enotifusertalkpage && $watchingUser->getOption('enotifusertalkpages') ) + ( $enotifusertalkpage + && $watchingUser->getOption('enotifusertalkpages') + && $title->equals( $watchingUser->getTalkPage() ) ) && (!$minorEdit || ($wgEnotifMinorEdits && $watchingUser->getOption('enotifminoredits') ) ) && ($watchingUser->isEmailConfirmed() ) ) { # ... adjust remaining text and page edit time placeholders @@ -286,7 +297,7 @@ class EmailNotification { ); # FIXME what do we do on failure ? } - + wfProfileOut( $fname ); } # function NotifyOnChange /** -- cgit v1.2.3-54-g00ecf