Merge "Make the 'other' option superessable in getSuggestedDurations"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Wed, 25 Jul 2018 17:06:06 +0000 (17:06 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Wed, 25 Jul 2018 17:06:06 +0000 (17:06 +0000)
includes/specials/SpecialBlock.php

index 92c6f50..3b25c6c 100644 (file)
@@ -854,9 +854,11 @@ class SpecialBlock extends FormSpecialPage {
         *     to the standard "**<duration>|<displayname>" 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';