X-Git-Url: https://git.cyclocoop.org/%20%27.%28%24debut%20%20%20%24par_page%29.%27?a=blobdiff_plain;f=includes%2FHtml.php;h=d0f9fc64e9bab6a1533c9928326696730455c606;hb=35252b7aaf421d44e15811095b07d5e0d011864e;hp=ebaff76d8a6899974848b8fd91d4db4a9123c856;hpb=51e00a4f262efb0faf1aac1e547086f9df6eedb8;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/Html.php b/includes/Html.php index ebaff76d8a..d0f9fc64e9 100644 --- a/includes/Html.php +++ b/includes/Html.php @@ -831,27 +831,25 @@ class Html { * @return array */ public static function namespaceSelectorOptions( array $params = [] ) { - $options = []; - if ( !isset( $params['exclude'] ) || !is_array( $params['exclude'] ) ) { $params['exclude'] = []; } - if ( isset( $params['all'] ) ) { - // add an option that would let the user select all namespaces. - // Value is provided by user, the name shown is localized for the user. - $options[$params['all']] = wfMessage( 'namespacesall' )->text(); - } if ( $params['in-user-lang'] ?? false ) { global $wgLang; $lang = $wgLang; } else { $lang = MediaWikiServices::getInstance()->getContentLanguage(); } - // Add all namespaces as options - $options += $lang->getFormattedNamespaces(); $optionsOut = []; + if ( isset( $params['all'] ) ) { + // add an option that would let the user select all namespaces. + // Value is provided by user, the name shown is localized for the user. + $optionsOut[$params['all']] = wfMessage( 'namespacesall' )->text(); + } + // Add all namespaces as options + $options = $lang->getFormattedNamespaces(); // Filter out namespaces below 0 and massage labels foreach ( $options as $nsId => $nsName ) { if ( $nsId < NS_MAIN || in_array( $nsId, $params['exclude'] ) ) {