r28784 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r28783‎ | r28784 | r28785 >
Date:20:19, 22 December 2007
Author:nikerabbit
Status:old
Tags:
Comment:
* Re-add removed offset and limit validation, could cause invalid queries
* Fixes bug 12350
Modified paths:
  • /trunk/phase3/includes/SpecialNewpages.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/SpecialNewpages.php
@@ -83,6 +83,15 @@
8484 }
8585 }
8686
 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+
8796 $nondefaults = array();
8897 foreach ( $options as $v => $t ) {
8998 if ( $v === 'offset' ) continue; # Reset offset if parameters change

Status & tagging log