X-Git-Url: https://git.cyclocoop.org/%28%28?a=blobdiff_plain;f=includes%2Fapi%2FApiQueryBlocks.php;h=7cc17557b5d562c83b27fbbd0902cfc2eafa4a8f;hb=7af38c756a0e0a50499375d43abb66a2aba781d8;hp=097487e397015ef6ebbc68d47c4727e5045e675d;hpb=e6faa2fd76040d1cbadc6e439ecf51f8f4e52bd4;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/api/ApiQueryBlocks.php b/includes/api/ApiQueryBlocks.php index 097487e397..7cc17557b5 100644 --- a/includes/api/ApiQueryBlocks.php +++ b/includes/api/ApiQueryBlocks.php @@ -182,8 +182,8 @@ class ApiQueryBlocks extends ApiQueryBase { $block['reason'] = $row->ipb_reason; } if ( $fld_range && !$row->ipb_auto ) { - $block['rangestart'] = IP::hexToQuad( $row->ipb_range_start ); - $block['rangeend'] = IP::hexToQuad( $row->ipb_range_end ); + $block['rangestart'] = IP::formatHex( $row->ipb_range_start ); + $block['rangeend'] = IP::formatHex( $row->ipb_range_end ); } if ( $fld_flags ) { // For clarity, these flags use the same names as their action=block counterparts @@ -299,9 +299,9 @@ class ApiQueryBlocks extends ApiQueryBase { 'start' => 'The timestamp to start enumerating from', 'end' => 'The timestamp to stop enumerating at', 'dir' => $this->getDirectionDescription( $p ), - 'ids' => 'Pipe-separated list of block IDs to list (optional)', - 'users' => 'Pipe-separated list of users to search for (optional)', - 'ip' => array( 'Get all blocks applying to this IP or CIDR range, including range blocks.', + 'ids' => 'List of block IDs to list (optional)', + 'users' => 'List of users to search for (optional)', + 'ip' => array( 'Get all blocks applying to this IP or CIDR range, including range blocks.', 'Cannot be used together with bkusers. CIDR ranges broader than /16 are not accepted' ), 'limit' => 'The maximum amount of blocks to list', 'prop' => array( @@ -383,13 +383,15 @@ class ApiQueryBlocks extends ApiQueryBase { } public function getPossibleErrors() { - return array_merge( parent::getPossibleErrors(), array( + return array_merge( parent::getPossibleErrors(), $this->getRequireOnlyOneParameterErrorMessages( array( 'users', 'ip' ) ), - array( 'code' => 'cidrtoobroad', 'info' => 'CIDR ranges broader than /16 are not accepted' ), - array( 'code' => 'param_user', 'info' => 'User parameter may not be empty' ), - array( 'code' => 'param_user', 'info' => 'User name user is not valid' ), - array( 'show' ), - ) ); + array( + array( 'code' => 'cidrtoobroad', 'info' => 'CIDR ranges broader than /16 are not accepted' ), + array( 'code' => 'param_user', 'info' => 'User parameter may not be empty' ), + array( 'code' => 'param_user', 'info' => 'User name user is not valid' ), + array( 'show' ), + ) + ); } public function getExamples() {