Use ->parse() for messages on Special:ResetTokens
[lhc/web/wiklou.git] / includes / QueryPage.php
index a4a1ffb..699c843 100644 (file)
@@ -69,8 +69,9 @@ $wgQueryPages = array(
 wfRunHooks( 'wgQueryPages', array( &$wgQueryPages ) );
 
 global $wgDisableCounters;
-if ( !$wgDisableCounters )
+if ( !$wgDisableCounters ) {
        $wgQueryPages[] = array( 'PopularPagesPage', 'Popularpages' );
+}
 
 /**
  * This is a class for doing query pages; since they're almost all the same,
@@ -587,7 +588,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 )
@@ -654,17 +655,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](