From: Siebrand Mazeland Date: Mon, 28 Sep 2015 11:47:16 +0000 (+0200) Subject: Fix PHPCS warnings in /includes/mail/ X-Git-Tag: 1.31.0-rc.0~9725^2 X-Git-Url: http://git.cyclocoop.org//%27%40script%40/%27?a=commitdiff_plain;h=6f1db0e3c9c3788a986c16891cd58e3f23ec4f5e;p=lhc%2Fweb%2Fwiklou.git Fix PHPCS warnings in /includes/mail/ Change-Id: Iea420ddecac86ef9a6f34b420b0cd151ba604e91 --- diff --git a/includes/mail/EmailNotification.php b/includes/mail/EmailNotification.php index 01b6afab40..31dd395128 100644 --- a/includes/mail/EmailNotification.php +++ b/includes/mail/EmailNotification.php @@ -148,11 +148,10 @@ class EmailNotification { $watchers = self::updateWatchlistTimestamp( $editor, $title, $timestamp ); $sendEmail = true; + // $watchers deals with $wgEnotifWatchlist. // If nobody is watching the page, and there are no users notified on all changes // don't bother creating a job/trying to send emails, unless it's a // talk page with an applicable notification. - // - // $watchers deals with $wgEnotifWatchlist if ( !count( $watchers ) && !count( $wgUsersNotifiedOnAllChanges ) ) { $sendEmail = false; // Only send notification for non minor edits, unless $wgEnotifMinorEdits diff --git a/includes/mail/UserMailer.php b/includes/mail/UserMailer.php index 7c5f18dd5f..3c28c5f5d0 100644 --- a/includes/mail/UserMailer.php +++ b/includes/mail/UserMailer.php @@ -178,32 +178,34 @@ class UserMailer { return Status::newFatal( 'user-mail-no-addy' ); } - // Forge email headers - // ------------------- - // - // WARNING - // - // DO NOT add To: or Subject: headers at this step. They need to be - // handled differently depending upon the mailer we are going to use. - // - // To: - // PHP mail() first argument is the mail receiver. The argument is - // used as a recipient destination and as a To header. - // - // PEAR mailer has a recipient argument which is only used to - // send the mail. If no To header is given, PEAR will set it to - // to 'undisclosed-recipients:'. - // - // NOTE: To: is for presentation, the actual recipient is specified - // by the mailer using the Rcpt-To: header. - // - // Subject: - // PHP mail() second argument to pass the subject, passing a Subject - // as an additional header will result in a duplicate header. - // - // PEAR mailer should be passed a Subject header. - // - // -- hashar 20120218 + /** + * Forge email headers + * ------------------- + * + * WARNING + * + * DO NOT add To: or Subject: headers at this step. They need to be + * handled differently depending upon the mailer we are going to use. + * + * To: + * PHP mail() first argument is the mail receiver. The argument is + * used as a recipient destination and as a To header. + * + * PEAR mailer has a recipient argument which is only used to + * send the mail. If no To header is given, PEAR will set it to + * to 'undisclosed-recipients:'. + * + * NOTE: To: is for presentation, the actual recipient is specified + * by the mailer using the Rcpt-To: header. + * + * Subject: + * PHP mail() second argument to pass the subject, passing a Subject + * as an additional header will result in a duplicate header. + * + * PEAR mailer should be passed a Subject header. + * + * -- hashar 20120218 + */ $headers['From'] = $from->toString(); $returnPath = $from->address; @@ -326,9 +328,7 @@ class UserMailer { MediaWiki\restoreWarnings(); return Status::newGood(); } else { - // // PHP mail() - // if ( count( $to ) > 1 ) { $headers['To'] = 'undisclosed-recipients:;'; }