Index: trunk/phase3/includes/PageHistory.php |
— | — | @@ -95,6 +95,14 @@ |
96 | 96 | * offset, the timestamp to begin at, from the URL. |
97 | 97 | */ |
98 | 98 | $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 | + |
99 | 107 | $offset = $wgRequest->getText('offset'); |
100 | 108 | |
101 | 109 | /* Offset must be an integral. */ |