summaryrefslogtreecommitdiff
path: root/includes/UserMailer.php
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2006-10-11 20:21:25 +0000
committerPierre Schmitz <pierre@archlinux.de>2006-10-11 20:21:25 +0000
commitd81f562b712f2387fa02290bf2ca86392ab356f2 (patch)
treed666cdefbe6ac320827a2c6cb473581b46e22c4c /includes/UserMailer.php
parent183851b06bd6c52f3cae5375f433da720d410447 (diff)
Aktualisierung auf Version 1.8.1
Diffstat (limited to 'includes/UserMailer.php')
-rw-r--r--includes/UserMailer.php17
1 files changed, 14 insertions, 3 deletions
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 <joe@bloggs.com>" 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
/**