Index: trunk/extensions/SemanticWatchlist/SemanticWatchlist.hooks.php |
— | — | @@ -76,20 +76,24 @@ |
77 | 77 | foreach ( $userIDs as $userID ) { |
78 | 78 | $user = User::newFromId( $userID ); |
79 | 79 | |
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 | + } |
94 | 98 | } |
95 | 99 | } |
96 | 100 | |