Update formatting on API classes
[lhc/web/wiklou.git] / includes / QueryPage.php
index a93639a..51b5706 100644 (file)
@@ -35,7 +35,6 @@ $wgQueryPages = array(
        array( 'AncientPagesPage',              'Ancientpages'                  ),
        array( 'BrokenRedirectsPage',           'BrokenRedirects'               ),
        array( 'DeadendPagesPage',              'Deadendpages'                  ),
-       array( 'DisambiguationsPage',           'Disambiguations'               ),
        array( 'DoubleRedirectsPage',           'DoubleRedirects'               ),
        array( 'FileDuplicateSearchPage',       'FileDuplicateSearch'           ),
        array( 'LinkSearchPage',                'LinkSearch'                    ),
@@ -588,7 +587,7 @@ abstract class QueryPage extends SpecialPage {
 
                        # $res might contain the whole 1,000 rows, so we read up to
                        # $num [should update this to use a Pager]
-                       for ( $i = 0; $i < $num && $row = $dbr->fetchObject( $res ); $i++ ) {
+                       for ( $i = 0; $i < $num && $row = $res->fetchObject(); $i++ ) {
                                $line = $this->formatResult( $skin, $row );
                                if ( $line ) {
                                        $attr = ( isset( $row->usepatrol ) && $row->usepatrol && $row->patrolled == 0 )
@@ -655,17 +654,14 @@ abstract class QueryPage extends SpecialPage {
         * @return bool
         */
        function doFeed( $class = '', $limit = 50 ) {
-               global $wgFeed, $wgFeedClasses;
+               global $wgFeed, $wgFeedClasses, $wgFeedLimit;
 
                if ( !$wgFeed ) {
                        $this->getOutput()->addWikiMsg( 'feed-unavailable' );
                        return false;
                }
 
-               global $wgFeedLimit;
-               if ( $limit > $wgFeedLimit ) {
-                       $limit = $wgFeedLimit;
-               }
+               $limit = min( $limit, $wgFeedLimit );
 
                if ( isset( $wgFeedClasses[$class] ) ) {
                        $feed = new $wgFeedClasses[$class](