From 63167c61514e7cf9b9a69ba8090278aaa80cbaf9 Mon Sep 17 00:00:00 2001 From: Nick Jenkins Date: Wed, 4 Oct 2006 08:41:42 +0000 Subject: [PATCH] =(Bug 6890) Limit Pager.php to prevent integer wraparound resulting in SQL errors --- RELEASE-NOTES | 2 ++ includes/Pager.php | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 7bafce986c..423733347d 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -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 == diff --git a/includes/Pager.php b/includes/Pager.php index 4a276ad4ba..b14aa8ca6e 100644 --- a/includes/Pager.php +++ b/includes/Pager.php @@ -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' ); -- 2.20.1