X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;f=includes%2Fmail%2FEmailNotification.php;h=314450470e5270ba77a433437c33ad3a8e86777a;hb=90d4f56fe46140f9e97e2fa72698f98b57447fe5;hp=2931d9dd3ccc8339b7a9cc87ee265bd8f48da2fa;hpb=a00e369aff80b2b338f26829b27cdeb8c66bf291;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/mail/EmailNotification.php b/includes/mail/EmailNotification.php index 2931d9dd3c..314450470e 100644 --- a/includes/mail/EmailNotification.php +++ b/includes/mail/EmailNotification.php @@ -90,7 +90,7 @@ class EmailNotification { LinkTarget $linkTarget, $timestamp ) { - // wfDeprecated( __METHOD__, '1.27' ); + wfDeprecated( __METHOD__, '1.27' ); $config = RequestContext::getMain()->getConfig(); if ( !$config->get( 'EnotifWatchlist' ) && !$config->get( 'ShowUpdatedMarker' ) ) { return []; @@ -452,7 +452,7 @@ class EmailNotification { * @private */ function sendPersonalised( $watchingUser, $source ) { - global $wgContLang, $wgEnotifUseRealName; + global $wgEnotifUseRealName; // From the PHP manual: // Note: The to parameter cannot be an address in the form of // "Something ". The mail command will not parse @@ -462,14 +462,15 @@ class EmailNotification { # $PAGEEDITDATE is the time and date of the page change # expressed in terms of individual local time of the notification # recipient, i.e. watching user + $contLang = MediaWikiServices::getInstance()->getContentLanguage(); $body = str_replace( [ '$WATCHINGUSERNAME', '$PAGEEDITDATE', '$PAGEEDITTIME' ], [ $wgEnotifUseRealName && $watchingUser->getRealName() !== '' ? $watchingUser->getRealName() : $watchingUser->getName(), - $wgContLang->userDate( $this->timestamp, $watchingUser ), - $wgContLang->userTime( $this->timestamp, $watchingUser ) ], + $contLang->userDate( $this->timestamp, $watchingUser ), + $contLang->userTime( $this->timestamp, $watchingUser ) ], $this->body ); $headers = []; @@ -490,19 +491,18 @@ class EmailNotification { * @return Status|null */ function sendImpersonal( $addresses ) { - global $wgContLang; - if ( empty( $addresses ) ) { return null; } + $contLang = MediaWikiServices::getInstance()->getContentLanguage(); $body = str_replace( [ '$WATCHINGUSERNAME', '$PAGEEDITDATE', '$PAGEEDITTIME' ], [ wfMessage( 'enotif_impersonal_salutation' )->inContentLanguage()->text(), - $wgContLang->date( $this->timestamp, false, false ), - $wgContLang->time( $this->timestamp, false, false ) ], + $contLang->date( $this->timestamp, false, false ), + $contLang->time( $this->timestamp, false, false ) ], $this->body ); return UserMailer::send( $addresses, $this->from, $this->subject, $body, [