From: Marius Hoch Date: Sun, 11 Nov 2012 02:25:17 +0000 (+0100) Subject: Fixed action=query list=blocks for IPv6 addresses X-Git-Tag: 1.31.0-rc.0~21632^2 X-Git-Url: https://git.cyclocoop.org/%27.WWW_URL.%27admin/?a=commitdiff_plain;h=7af38c756a0e0a50499375d43abb66a2aba781d8;p=lhc%2Fweb%2Fwiklou.git Fixed action=query list=blocks for IPv6 addresses Queries like the following return wrong rangestart and rangeend data cause the IP addresses are formated with only IPv4 in mind. As IP::formatHex is able to format both I've switched over to that. Example: http://en.wikipedia.org/w/api.php?format=xml&action=query&list=blocks&bkprop=range&bkip=2002%3AB752%3AD225%3A0%3A0%3A0%3A0%3A1 Change-Id: I6138240bb03bbf5af61851d3e96354a050e56fed --- diff --git a/includes/api/ApiQueryBlocks.php b/includes/api/ApiQueryBlocks.php index a8d4a7c327..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