From 322d64cb06af125728f391ebdff9fd895f68b2d4 Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Fri, 23 Jun 2006 06:39:40 +0000 Subject: [PATCH] bounding for the limit parameter --- includes/PageHistory.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/includes/PageHistory.php b/includes/PageHistory.php index 8b72a0a765..074c3eda41 100644 --- a/includes/PageHistory.php +++ b/includes/PageHistory.php @@ -95,6 +95,14 @@ class PageHistory { * offset, the timestamp to begin at, from the URL. */ $limit = $wgRequest->getInt('limit', $this->defaultLimit); + if ( $limit <= 0 ) { + $limit = $this->defaultLimit; + } elseif ( $limit > 50000 ) { + # Arbitrary maximum + # Any more than this and we'll probably get an out of memory error + $limit = 50000; + } + $offset = $wgRequest->getText('offset'); /* Offset must be an integral. */ -- 2.20.1