Index: trunk/extensions/FlaggedRevs/FlaggedRevs.php |
— | — | @@ -173,7 +173,7 @@ |
174 | 174 | 'userpageBytes' => 0, # userpage is needed? with what min size? |
175 | 175 | 'uniqueIPAddress' => false, # If $wgPutIPinRC is true, users sharing IPs won't be promoted |
176 | 176 | 'neverBlocked' => true, # Can users that were blocked be promoted? |
177 | | - 'maxRevertedEdits' => 5, # Max edits the user could have had rolled back? |
| 177 | + 'maxRevertedEdits' => 5, # Max times the user could have edits undone/"rolled back"? |
178 | 178 | ); |
179 | 179 | |
180 | 180 | # Define when users get to have their own edits auto-reviewed. Set to false to disable. |
Index: trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php |
— | — | @@ -1112,14 +1112,17 @@ |
1113 | 1113 | } |
1114 | 1114 | |
1115 | 1115 | public static function incrementRollbacks( |
1116 | | - $article, $user, $target, Revision $current |
| 1116 | + Article $article, $user, $goodRev, Revision $badRev |
1117 | 1117 | ) { |
1118 | 1118 | # Mark when a user reverts another user, but not self-reverts |
1119 | | - if ( $current->getRawUser() && $user->getId() != $current->getRawUser() ) { |
1120 | | - $p = FlaggedRevs::getUserParams( $current->getRawUser() ); |
1121 | | - $p['revertedEdits'] = isset( $p['revertedEdits'] ) ? $p['revertedEdits'] : 0; |
| 1119 | + $badUserId = $badRev->getRawUser(); |
| 1120 | + if ( $badUserId && $user->getId() != $badUserId ) { |
| 1121 | + $p = FlaggedRevs::getUserParams( $badUserId ); |
| 1122 | + if ( !isset( $p['revertedEdits'] ) ) { |
| 1123 | + $p['revertedEdits'] = 0; |
| 1124 | + } |
1122 | 1125 | $p['revertedEdits']++; |
1123 | | - FlaggedRevs::saveUserParams( $current->getRawUser(), $p ); |
| 1126 | + FlaggedRevs::saveUserParams( $badUserId, $p ); |
1124 | 1127 | } |
1125 | 1128 | return true; |
1126 | 1129 | } |