Index: trunk/phase3/includes/SpecialNewpages.php |
— | — | @@ -83,6 +83,15 @@ |
84 | 84 | } |
85 | 85 | } |
86 | 86 | |
| 87 | + // Validate limit and offset params |
| 88 | + if ( $options['limit'] <= 0 ) { |
| 89 | + $options['limit'] = $defaults['limit']; |
| 90 | + } |
| 91 | + |
| 92 | + if ( $options['offset'] < 0 ) { |
| 93 | + $options['offset'] = $defaults['offset']; |
| 94 | + } |
| 95 | + |
87 | 96 | $nondefaults = array(); |
88 | 97 | foreach ( $options as $v => $t ) { |
89 | 98 | if ( $v === 'offset' ) continue; # Reset offset if parameters change |