From: Huji Lee Date: Mon, 30 Apr 2018 01:38:42 +0000 (-0400) Subject: Make the 'other' option superessable in getSuggestedDurations X-Git-Tag: 1.34.0-rc.0~4662^2 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/banques/%7B%7B%20url_for%28%27admin_users%27%29%20%7D%7D?a=commitdiff_plain;h=2d8783897a5f05937d330180cd5f6904ac43c33b;p=lhc%2Fweb%2Fwiklou.git Make the 'other' option superessable in getSuggestedDurations Bug: T193364 Change-Id: Ic2dbc961f7eebad11da53724b9cce2f804ffad39 --- 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';