Moved $wgQueryPages stuff out of the global scope and into a function
[lhc/web/wiklou.git] / includes / UserMailer.php
index e1d00d3..de4457d 100644 (file)
@@ -262,8 +262,7 @@ class UserMailer {
                                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 {
+                       } else {
                                require_once 'Mail/mime.php';
                                if ( wfIsWindows() ) {
                                        $body['text'] = str_replace( "\n", "\r\n", $body['text'] );
@@ -276,7 +275,7 @@ class UserMailer {
                                $headers = $mime->headers( $headers );
                        }
                }
-               if ( !isset( $mime ) ) {
+               if ( $mime === null ) {
                        // sending text only, either deliberately or as a fallback
                        if ( wfIsWindows() ) {
                                $body = str_replace( "\n", "\r\n", $body );
@@ -649,7 +648,9 @@ class EmailNotification {
                                                && $watchingUser->isEmailConfirmed()
                                                && $watchingUser->getID() != $userTalkId
                                        ) {
-                                               $this->compose( $watchingUser );
+                                               if ( wfRunHooks( 'SendWatchlistEmailNotification', array( $watchingUser, $title, $this ) ) ) {
+                                                       $this->compose( $watchingUser );
+                                               }
                                        }
                                }
                        }