Index: trunk/phase3/includes/specials/SpecialBlockip.php |
— | — | @@ -539,19 +539,20 @@ |
540 | 540 | } |
541 | 541 | } |
542 | 542 | |
543 | | - public static function suppressUserName( $name, $userId ) { |
| 543 | + public static function suppressUserName( $name, $userId, $dbw = null ) { |
544 | 544 | $op = '|'; // bitwise OR |
545 | | - return self::setUsernameBitfields( $name, $userId, $op ); |
| 545 | + return self::setUsernameBitfields( $name, $userId, $op, $dbw ); |
546 | 546 | } |
547 | 547 | |
548 | | - public static function unsuppressUserName( $name, $userId ) { |
| 548 | + public static function unsuppressUserName( $name, $userId, $dbw = null ) { |
549 | 549 | $op = '&'; // bitwise AND |
550 | | - return self::setUsernameBitfields( $name, $userId, $op ); |
| 550 | + return self::setUsernameBitfields( $name, $userId, $op, $dbw ); |
551 | 551 | } |
552 | 552 | |
553 | | - private static function setUsernameBitfields( $name, $userId, $op ) { |
| 553 | + private static function setUsernameBitfields( $name, $userId, $op, $dbw ) { |
554 | 554 | if( $op !== '|' && $op !== '&' ) return false; // sanity check |
555 | | - $dbw = wfGetDB( DB_MASTER ); |
| 555 | + if( !$dbw ) |
| 556 | + $dbw = wfGetDB( DB_MASTER ); |
556 | 557 | $delUser = Revision::DELETED_USER | Revision::DELETED_RESTRICTED; |
557 | 558 | $delAction = LogPage::DELETED_ACTION | Revision::DELETED_RESTRICTED; |
558 | 559 | # Normalize user name |