* Follow-up r84610: don't assume a Parser object is attached
[lhc/web/wiklou.git] / includes / QueryPage.php
index 7edc7db..2dc9ac6 100644 (file)
@@ -381,9 +381,9 @@ abstract class QueryPage extends SpecialPage {
        }
 
        /**
-        * Parameters and order changed in 1.18
+        * Somewhat deprecated, you probably want to be using execute()
         */
-       function doQuery( $limit, $offset = false ) {
+       function doQuery( $offset = false, $limit = false ) {
                if ( $this->isCached() && $this->isCacheable() ) {
                        return $this->fetchFromCache( $limit, $offset );
                } else {
@@ -552,8 +552,9 @@ abstract class QueryPage extends SpecialPage {
 
                if ( $num > 0 ) {
                        $html = array();
-                       if ( !$this->listoutput )
+                       if ( !$this->listoutput ) {
                                $html[] = $this->openList( $offset );
+                       }
 
                        # $res might contain the whole 1,000 rows, so we read up to
                        # $num [should update this to use a Pager]
@@ -583,8 +584,9 @@ abstract class QueryPage extends SpecialPage {
                                }
                        }
 
-                       if ( !$this->listoutput )
+                       if ( !$this->listoutput ) {
                                $html[] = $this->closeList();
+                       }
 
                        $html = $this->listoutput
                                ? $wgContLang->listToText( $html )
@@ -631,7 +633,6 @@ abstract class QueryPage extends SpecialPage {
                                $this->feedUrl() );
                        $feed->outHeader();
 
-                       $dbr = wfGetDB( DB_SLAVE );
                        $res = $this->reallyDoQuery( $limit, 0 );
                        foreach ( $res as $obj ) {
                                $item = $this->feedResult( $obj );