r93118 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r93117‎ | r93118 | r93119 >
Date:21:14, 25 July 2011
Author:jeroendedauw
Status:deferred
Tags:
Comment:
fix compat with 1.17
Modified paths:
  • /trunk/extensions/SemanticWatchlist/SemanticWatchlist.hooks.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticWatchlist/SemanticWatchlist.hooks.php
@@ -76,20 +76,24 @@
7777 foreach ( $userIDs as $userID ) {
7878 $user = User::newFromId( $userID );
7979
80 - if ( $user->getOption( 'swl_email', false ) && Sanitizer::validateEmail( $user->getEmail() ) ) {
81 - $lastNotify = $user->getOption( 'swl_last_notify' );
82 - $lastWatch = $user->getOption( 'swl_last_watch' );
83 -
84 - if ( is_null( $lastNotify ) || is_null( $lastWatch ) || $lastNotify < $lastWatch ) {
85 - $mailCount = $user->getOption( 'swl_mail_count', 0 );
86 -
87 - if ( $egSWLMailPerChange || $mailCount < $egSWLMaxMails ) {
88 - SWLEmailer::notifyUser( $group, $user, $changes, $egSWLMailPerChange );
89 - $user->setOption( 'swl_last_notify', wfTimestampNow() );
90 - $user->setOption( 'swl_mail_count', $mailCount + 1 );
91 - $user->saveSettings();
92 - }
93 - }
 80+ if ( $user->getOption( 'swl_email', false ) ) {
 81+ $realFunction = array( 'Sanitizer', 'validateEmail' );
 82+
 83+ if ( !method_exists( $realFunction ) || Sanitizer::validateEmail( $user->getEmail() ) ) {
 84+ $lastNotify = $user->getOption( 'swl_last_notify' );
 85+ $lastWatch = $user->getOption( 'swl_last_watch' );
 86+
 87+ if ( is_null( $lastNotify ) || is_null( $lastWatch ) || $lastNotify < $lastWatch ) {
 88+ $mailCount = $user->getOption( 'swl_mail_count', 0 );
 89+
 90+ if ( $egSWLMailPerChange || $mailCount < $egSWLMaxMails ) {
 91+ SWLEmailer::notifyUser( $group, $user, $changes, $egSWLMailPerChange );
 92+ $user->setOption( 'swl_last_notify', wfTimestampNow() );
 93+ $user->setOption( 'swl_mail_count', $mailCount + 1 );
 94+ $user->saveSettings();
 95+ }
 96+ }
 97+ }
9498 }
9599 }
96100

Follow-up revisions

RevisionCommit summaryAuthorDate
r93121fu r93118jeroendedauw21:23, 25 July 2011