(bug 5475) New pages feeds ignore "limit" argument
authorRob Church <robchurch@users.mediawiki.org>
Thu, 13 Apr 2006 20:01:48 +0000 (20:01 +0000)
committerRob Church <robchurch@users.mediawiki.org>
Thu, 13 Apr 2006 20:01:48 +0000 (20:01 +0000)
RELEASE-NOTES
includes/GlobalFunctions.php
includes/QueryPage.php
includes/SpecialNewpages.php

index 68a458f..38b7534 100644 (file)
@@ -63,6 +63,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
 * Reject malformed addresses in X-Forwarded-For entries
 * (bug 3359) Add hooks on completion of file upload
 * (bug 5559) Improve detection of ImageMagick [patch: Greg Turnquist]
+* (bug 5475) New pages feeds ignore "limit" argument
 
 == Compatibility ==
 
index 795883e..491a09a 100644 (file)
@@ -791,7 +791,13 @@ function wfClientAcceptsGzip() {
 }
 
 /**
- * Yay, more global functions!
+ * Obtain the offset and limit values from the request string;
+ * used in special pages
+ *
+ * @param $deflimit Default limit if none supplied
+ * @param $optionname Name of a user preference to check against
+ * @return array
+ * 
  */
 function wfCheckLimits( $deflimit = 50, $optionname = 'rclimit' ) {
        global $wgRequest;
index 9b39ec6..1d354d9 100644 (file)
@@ -344,7 +344,7 @@ class QueryPage {
        /**
         * Similar to above, but packaging in a syndicated feed instead of a web page
         */
-       function doFeed( $class = '' ) {
+       function doFeed( $class = '', $limit = 50 ) {
                global $wgFeedClasses;
 
                if( isset($wgFeedClasses[$class]) ) {
@@ -356,7 +356,7 @@ class QueryPage {
 
                        $dbr =& wfGetDB( DB_SLAVE );
                        $sql = $this->getSQL() . $this->getOrder();
-                       $sql = $dbr->limitResult( $sql, 50, 0 );
+                       $sql = $dbr->limitResult( $sql, $limit, 0 );
                        $res = $dbr->query( $sql, 'QueryPage::doFeed' );
                        while( $obj = $dbr->fetchObject( $res ) ) {
                                $item = $this->feedResult( $obj );
index 2a7db04..7c7b97e 100644 (file)
@@ -142,7 +142,7 @@ function wfSpecialNewpages($par, $specialPage) {
 
        $npp = new NewPagesPage( $namespace );
 
-       if ( ! $npp->doFeed( $wgRequest->getVal( 'feed' ) ) )
+       if ( ! $npp->doFeed( $wgRequest->getVal( 'feed' ), $limit ) )
                $npp->doQuery( $offset, $limit, $shownavigation );
 }