r105341 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r105340‎ | r105341 | r105342 >
Date:19:45, 6 December 2011
Author:brion
Status:ok
Tags:
Comment:
Followup r104350, r104318: only allow custom limits through if they're valid positive ints.
Modified paths:
  • /trunk/phase3/includes/specials/SpecialBlockList.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/specials/SpecialBlockList.php
@@ -468,7 +468,11 @@
469469 return true;
470470 }
471471
472 - if ( !in_array( $value, $this->mParams['options'] ) ) {
 472+ // Let folks pick an explicit limit not from our list, as long as it's a real numbr.
 473+ if ( !in_array( $value, $this->mParams['options'] ) && $value == intval( $value ) && $value > 0 ) {
 474+ // This adds the explicitly requested limit value to the drop-down,
 475+ // then makes sure it's sorted correctly so when we output the list
 476+ // later, the custom option doesn't just show up last.
473477 $this->mParams['options'][ $this->mParent->getLanguage()->formatNum( $value ) ] = intval($value);
474478 asort( $this->mParams['options'] );
475479 }

Follow-up revisions

RevisionCommit summaryAuthorDate
r107926MFT r105341, r105853, r105897reedy19:26, 3 January 2012
r107975MFT r105341, t105853, r106780reedy00:40, 4 January 2012

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r104318Bug 32603 - limit option is missing on Special:BlockList...johnduhart22:15, 26 November 2011
r104350Followup r104318, sort the options in the limit dropdownjohnduhart17:31, 27 November 2011

Status & tagging log