dépôts
/
lhc
/
web
/
wiklou.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
eac0376
)
bounding for the limit parameter
author
Tim Starling
<tstarling@users.mediawiki.org>
Fri, 23 Jun 2006 06:39:40 +0000
(06:39 +0000)
committer
Tim Starling
<tstarling@users.mediawiki.org>
Fri, 23 Jun 2006 06:39:40 +0000
(06:39 +0000)
includes/PageHistory.php
patch
|
blob
|
history
diff --git
a/includes/PageHistory.php
b/includes/PageHistory.php
index
8b72a0a
..
074c3ed
100644
(file)
--- 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. */