From 7af38c756a0e0a50499375d43abb66a2aba781d8 Mon Sep 17 00:00:00 2001 From: Marius Hoch Date: Sun, 11 Nov 2012 03:25:17 +0100 Subject: [PATCH] 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 --- includes/api/ApiQueryBlocks.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 -- 2.20.1