test: skip math parser tests when missing $wgTexvc
[lhc/web/wiklou.git] / includes / UserMailer.php
index 7eca76f..2a549ac 100644 (file)
@@ -260,7 +260,7 @@ class UserMailer {
                                wfDebug( "PEAR Mail_Mime package is not installed. Falling back to text email.\n" );
                        }
                        else {
-                               require_once( 'Mail/mime.php' );
+                               require_once 'Mail/mime.php';
                                if ( wfIsWindows() ) {
                                        $body['text'] = str_replace( "\n", "\r\n", $body['text'] );
                                        $body['html'] = str_replace( "\n", "\r\n", $body['html'] );
@@ -300,7 +300,7 @@ class UserMailer {
                        if ( !stream_resolve_include_path( 'Mail.php' ) ) {
                                throw new MWException( 'PEAR mail package is not installed' );
                        }
-                       require_once( 'Mail.php' );
+                       require_once 'Mail.php';
 
                        wfSuppressWarnings();
 
@@ -668,11 +668,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" );
@@ -703,14 +705,14 @@ class EmailNotification {
                if ( $this->oldid ) {
                        // Always show a link to the diff which triggered the mail. See bug 32210.
                        $keys['$NEWPAGE'] = "\n\n" . wfMessage( 'enotif_lastdiff',
-                               $this->title->getCanonicalURL( 'diff=next&oldid=' . $this->oldid ) )
+                               $this->title->getCanonicalURL( array( 'diff' => 'next', 'oldid' => $this->oldid ) ) )
                                ->inContentLanguage()->text();
 
                        if ( !$wgEnotifImpersonal ) {
                                // For personal mail, also show a link to the diff of all changes
                                // since last visited.
                                $keys['$NEWPAGE'] .= "\n\n" . wfMessage( 'enotif_lastvisited',
-                                       $this->title->getCanonicalURL( 'diff=0&oldid=' . $this->oldid ) )
+                                       $this->title->getCanonicalURL( array( 'diff' => '0', 'oldid' => $this->oldid ) ) )
                                        ->inContentLanguage()->text();
                        }
                        $keys['$OLDID'] = $this->oldid;