r14926 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r14925‎ | r14926 | r14927 >
Date:06:39, 23 June 2006
Author:tstarling
Status:old
Tags:
Comment:
bounding for the limit parameter
Modified paths:
  • /trunk/phase3/includes/PageHistory.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/PageHistory.php
@@ -95,6 +95,14 @@
9696 * offset, the timestamp to begin at, from the URL.
9797 */
9898 $limit = $wgRequest->getInt('limit', $this->defaultLimit);
 99+ if ( $limit <= 0 ) {
 100+ $limit = $this->defaultLimit;
 101+ } elseif ( $limit > 50000 ) {
 102+ # Arbitrary maximum
 103+ # Any more than this and we'll probably get an out of memory error
 104+ $limit = 50000;
 105+ }
 106+
99107 $offset = $wgRequest->getText('offset');
100108
101109 /* Offset must be an integral. */

Status & tagging log