From 2d8783897a5f05937d330180cd5f6904ac43c33b Mon Sep 17 00:00:00 2001 From: Huji Lee Date: Sun, 29 Apr 2018 21:38:42 -0400 Subject: [PATCH] Make the 'other' option superessable in getSuggestedDurations Bug: T193364 Change-Id: Ic2dbc961f7eebad11da53724b9cce2f804ffad39 --- includes/specials/SpecialBlock.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/includes/specials/SpecialBlock.php b/includes/specials/SpecialBlock.php index 92c6f504dd..3b25c6c2af 100644 --- a/includes/specials/SpecialBlock.php +++ b/includes/specials/SpecialBlock.php @@ -854,9 +854,11 @@ class SpecialBlock extends FormSpecialPage { * to the standard "**|" format? * @param Language|null $lang The language to get the durations in, or null to use * the wiki's content language + * @param bool $includeOther Whether to include the 'other' option in the list of + * suggestions * @return array */ - public static function getSuggestedDurations( $lang = null ) { + public static function getSuggestedDurations( $lang = null, $includeOther = true ) { $a = []; $msg = $lang === null ? wfMessage( 'ipboptions' )->inContentLanguage()->text() @@ -875,7 +877,7 @@ class SpecialBlock extends FormSpecialPage { $a[$show] = $value; } - if ( $a ) { + if ( $a && $includeOther ) { // if options exist, add other to the end instead of the begining (which // is what happens by default). $a[ wfMessage( 'ipbother' )->text() ] = 'other'; -- 2.20.1