From 598481687a1b4660552474db2c2dba5f9effa862 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Tue, 6 Dec 2011 19:45:56 +0000 Subject: [PATCH] Followup r104350, r104318: only allow custom limits through if they're valid positive ints. --- includes/specials/SpecialBlockList.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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'] ); } -- 2.20.1