=(Bug 6890) Limit Pager.php to prevent integer wraparound resulting in SQL errors
authorNick Jenkins <nickj@users.mediawiki.org>
Wed, 4 Oct 2006 08:41:42 +0000 (08:41 +0000)
committerNick Jenkins <nickj@users.mediawiki.org>
Wed, 4 Oct 2006 08:41:42 +0000 (08:41 +0000)
RELEASE-NOTES
includes/Pager.php

index 7bafce9..4237333 100644 (file)
@@ -259,6 +259,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
   for watch/unwatch, group membership change, and login operations
 * Restructured the languages directory, to avoid problems when people 
   untar MW 1.8 over the top of a 1.7 installation.  
+* (bug 6890) SQL query error on bad input to Pager lists 
+  due to negative LIMIT clause, caused by integer wraparound.
 
 == Languages updated ==
 
index 4a276ad..b14aa8c 100644 (file)
@@ -77,7 +77,7 @@ abstract class IndexPager implements Pager {
                # HTML!
                $this->mOffset = $this->mRequest->getText( 'offset' );
                $this->mLimit = $this->mRequest->getInt( 'limit', $this->mDefaultLimit );
-               if ( $this->mLimit <= 0 ) {
+               if ( $this->mLimit <= 0 || $this->mLimit > 50000 ) {
                        $this->mLimit = $this->mDefaultLimit;
                }
                $this->mIsBackwards = ( $this->mRequest->getVal( 'dir' ) == 'prev' );