r40396 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r40395‎ | r40396 | r40397 >
Date:21:25, 3 September 2008
Author:nad
Status:old
Tags:
Comment:
need to use global userMailer function for <1.12
Modified paths:
  • /trunk/extensions/CategoryWatch/CategoryWatch.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CategoryWatch/CategoryWatch.php
@@ -70,7 +70,6 @@
7171
7272 # Notify watchers of each cat about the addition or removal of this article
7373 if (count($add) > 0 || count($sub) > 0) {
74 - $enotif = new EmailNotification(); # ensure UserMailer class is autoloaded
7574 $page = $article->getTitle()->getText();
7675 if (count($add) == 1 && count($sub) == 1) {
7776 $add = array_shift($add);
@@ -130,13 +129,24 @@
131130 $editor->getName(),
132131 $message
133132 );
134 - UserMailer::send(
135 - $to,
136 - $from,
137 - wfMsg('categorywatch-emailsubject', $page),
138 - $body,
139 - $replyto
140 - );
 133+ if (function_exists('userMailer')) {
 134+ userMailer(
 135+ $to,
 136+ $from,
 137+ wfMsg('categorywatch-emailsubject', $page),
 138+ $body,
 139+ $replyto
 140+ );
 141+ }
 142+ else {
 143+ UserMailer::send(
 144+ $to,
 145+ $from,
 146+ wfMsg('categorywatch-emailsubject', $page),
 147+ $body,
 148+ $replyto
 149+ );
 150+ }
141151 }
142152 }
143153