Merge "(bug 46059) giving #p-personal a higher z-index than #content in monobook"
[lhc/web/wiklou.git] / includes / api / ApiQueryBlocks.php
index a8d4a7c..ba90452 100644 (file)
@@ -63,7 +63,7 @@ class ApiQueryBlocks extends ApiQueryBase {
                $this->addTables( 'ipblocks' );
                $this->addFields( 'ipb_auto' );
 
-               $this->addFieldsIf ( 'ipb_id', $fld_id );
+               $this->addFieldsIf( 'ipb_id', $fld_id );
                $this->addFieldsIf( array( 'ipb_address', 'ipb_user' ), $fld_user || $fld_userid );
                $this->addFieldsIf( 'ipb_by_text', $fld_by );
                $this->addFieldsIf( 'ipb_by', $fld_byid );
@@ -132,10 +132,10 @@ class ApiQueryBlocks extends ApiQueryBase {
                        $this->addWhereIf( 'ipb_user != 0', isset( $show['account'] ) );
                        $this->addWhereIf( 'ipb_user != 0 OR ipb_range_end > ipb_range_start', isset( $show['!ip'] ) );
                        $this->addWhereIf( 'ipb_user = 0 AND ipb_range_end = ipb_range_start', isset( $show['ip'] ) );
-                       $this->addWhereIf( 'ipb_expiry =  '.$db->addQuotes($db->getInfinity()), isset( $show['!temp'] ) );
-                       $this->addWhereIf( 'ipb_expiry != '.$db->addQuotes($db->getInfinity()), isset( $show['temp'] ) );
-                       $this->addWhereIf( "ipb_range_end = ipb_range_start", isset( $show['!range'] ) );
-                       $this->addWhereIf( "ipb_range_end > ipb_range_start", isset( $show['range'] ) );
+                       $this->addWhereIf( 'ipb_expiry = ' . $db->addQuotes( $db->getInfinity() ), isset( $show['!temp'] ) );
+                       $this->addWhereIf( 'ipb_expiry != ' . $db->addQuotes( $db->getInfinity() ), isset( $show['temp'] ) );
+                       $this->addWhereIf( 'ipb_range_end = ipb_range_start', isset( $show['!range'] ) );
+                       $this->addWhereIf( 'ipb_range_end > ipb_range_start', isset( $show['range'] ) );
                }
 
                if ( !$this->getUser()->isAllowed( 'hideuser' ) ) {
@@ -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
@@ -404,8 +404,4 @@ class ApiQueryBlocks extends ApiQueryBase {
        public function getHelpUrls() {
                return 'https://www.mediawiki.org/wiki/API:Blocks';
        }
-
-       public function getVersion() {
-               return __CLASS__ . ': $Id$';
-       }
 }