Merge "Improve docs for Title::getInternalURL/getCanonicalURL"
[lhc/web/wiklou.git] / includes / api / ApiQueryBlocks.php
index caaebc9..8aff2aa 100644 (file)
@@ -103,7 +103,7 @@ class ApiQueryBlocks extends ApiQueryBase {
                }
 
                if ( isset( $params['ids'] ) ) {
-                       $this->addWhereFld( 'ipb_id', $params['ids'] );
+                       $this->addWhereIDsFld( 'ipblocks', 'ipb_id', $params['ids'] );
                }
                if ( isset( $params['users'] ) ) {
                        $usernames = [];
@@ -305,7 +305,9 @@ class ApiQueryBlocks extends ApiQueryBase {
                        switch ( $restriction->getType() ) {
                                case 'page':
                                        $value = [ 'id' => $restriction->getValue() ];
-                                       self::addTitleInfo( $value, $restriction->getTitle() );
+                                       if ( $restriction->getTitle() ) {
+                                               self::addTitleInfo( $value, $restriction->getTitle() );
+                                       }
                                        break;
                                default:
                                        $value = $restriction->getValue();