From: Brion Vibber Date: Tue, 6 Dec 2011 19:45:56 +0000 (+0000) Subject: Followup r104350, r104318: only allow custom limits through if they're valid positive... X-Git-Tag: 1.31.0-rc.0~26153 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/operations/recherche.php?a=commitdiff_plain;h=598481687a1b4660552474db2c2dba5f9effa862;p=lhc%2Fweb%2Fwiklou.git Followup r104350, r104318: only allow custom limits through if they're valid positive ints. --- diff --git a/includes/specials/SpecialBlockList.php b/includes/specials/SpecialBlockList.php index 719a3381b9..ea6fe22f0f 100644 --- a/includes/specials/SpecialBlockList.php +++ b/includes/specials/SpecialBlockList.php @@ -468,7 +468,11 @@ class HTMLBlockedUsersItemSelect extends HTMLSelectField { return true; } - if ( !in_array( $value, $this->mParams['options'] ) ) { + // Let folks pick an explicit limit not from our list, as long as it's a real numbr. + if ( !in_array( $value, $this->mParams['options'] ) && $value == intval( $value ) && $value > 0 ) { + // This adds the explicitly requested limit value to the drop-down, + // then makes sure it's sorted correctly so when we output the list + // later, the custom option doesn't just show up last. $this->mParams['options'][ $this->mParent->getLanguage()->formatNum( $value ) ] = intval($value); asort( $this->mParams['options'] ); }