| Index: trunk/extensions/AbuseFilter/api/ApiCheckFilterMatch.php |
| — | — | @@ -15,8 +15,11 @@ |
| 16 | 16 | $vars = json_decode( $params['vars'], true ); |
| 17 | 17 | } elseif ( $params['rcid'] ) { |
| 18 | 18 | $dbr = wfGetDB( DB_SLAVE ); |
| 19 | | - $row = $dbr->selectRow( 'recentchanges', '*', |
| 20 | | - array( 'rc_id' => $params['rcid'] ), __METHOD__ |
| | 19 | + $row = $dbr->selectRow( |
| | 20 | + 'recentchanges', |
| | 21 | + '*', |
| | 22 | + array( 'rc_id' => $params['rcid'] ), |
| | 23 | + __METHOD__ |
| 21 | 24 | ); |
| 22 | 25 | |
| 23 | 26 | if ( !$row ) { |
| — | — | @@ -26,8 +29,11 @@ |
| 27 | 30 | $vars = AbuseFilter::getVarsFromRCRow( $row ); |
| 28 | 31 | } elseif ( $params['logid'] ) { |
| 29 | 32 | $dbr = wfGetDB( DB_SLAVE ); |
| 30 | | - $row = $dbr->selectRow( 'abuse_filter_log', '*', |
| 31 | | - array( 'afl_id' => $params['logid'] ), __METHOD__ |
| | 33 | + $row = $dbr->selectRow( |
| | 34 | + 'abuse_filter_log', |
| | 35 | + '*', |
| | 36 | + array( 'afl_id' => $params['logid'] ), |
| | 37 | + __METHOD__ |
| 32 | 38 | ); |
| 33 | 39 | |
| 34 | 40 | if ( !$row ) { |
| — | — | @@ -86,12 +92,14 @@ |
| 87 | 93 | |
| 88 | 94 | public function getPossibleErrors() { |
| 89 | 95 | return array_merge( parent::getPossibleErrors(), |
| 90 | | - $this->getRequireOnlyOneParameterErrorMessages( array( 'vars', 'rcid', 'logid' ) ), array( |
| 91 | | - array( 'permissiondenied' ), |
| 92 | | - array( 'nosuchrcid' ), |
| 93 | | - array( 'code' => 'nosuchlogid', 'info' => 'There is no abuselog entry with the id given' ), |
| 94 | | - array( 'code' => 'badsyntax', 'info' => 'The filter has invalid syntax' ), |
| 95 | | - ) ); |
| | 96 | + $this->getRequireOnlyOneParameterErrorMessages( array( 'vars', 'rcid', 'logid' ) ), |
| | 97 | + array( |
| | 98 | + array( 'permissiondenied' ), |
| | 99 | + array( 'nosuchrcid' ), |
| | 100 | + array( 'code' => 'nosuchlogid', 'info' => 'There is no abuselog entry with the id given' ), |
| | 101 | + array( 'code' => 'badsyntax', 'info' => 'The filter has invalid syntax' ), |
| | 102 | + ) |
| | 103 | + ); |
| 96 | 104 | } |
| 97 | 105 | |
| 98 | 106 | public function getExamples() { |
| Index: trunk/extensions/AbuseFilter/api/ApiCheckFilterSyntax.php |
| — | — | @@ -4,13 +4,13 @@ |
| 5 | 5 | |
| 6 | 6 | public function execute() { |
| 7 | 7 | global $wgUser; |
| 8 | | - $params = $this->extractRequestParams(); |
| 9 | 8 | |
| 10 | 9 | // "Anti-DoS" |
| 11 | 10 | if ( !$wgUser->isAllowed( 'abusefilter-modify' ) ) { |
| 12 | 11 | $this->dieUsageMsg( 'permissiondenied' ); |
| 13 | 12 | } |
| 14 | 13 | |
| | 14 | + $params = $this->extractRequestParams(); |
| 15 | 15 | $result = AbuseFilter::checkSyntax( $params[ 'filter' ] ); |
| 16 | 16 | |
| 17 | 17 | $r = array(); |
| Index: trunk/extensions/AbuseFilter/api/ApiUnblockAutopromote.php |
| — | — | @@ -3,13 +3,12 @@ |
| 4 | 4 | class ApiUnblockAutopromote extends ApiBase { |
| 5 | 5 | public function execute() { |
| 6 | 6 | global $wgUser; |
| 7 | | - $params = $this->extractRequestParams(); |
| 8 | | - $res = array(); |
| 9 | 7 | |
| 10 | 8 | if ( !$wgUser->isAllowed( 'abusefilter-modify' ) ) { |
| 11 | 9 | $this->dieUsage( 'You do not have permissions to unblock autopromotion', 'permissiondenied' ); |
| 12 | 10 | } |
| 13 | 11 | |
| | 12 | + $params = $this->extractRequestParams(); |
| 14 | 13 | $user = User::newFromName( $params['user'] ); |
| 15 | 14 | |
| 16 | 15 | if ( $user === false ) { |