Merge "Change 'editfont' default preference to 'monospace'"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Mon, 21 Aug 2017 16:42:23 +0000 (16:42 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Mon, 21 Aug 2017 16:42:23 +0000 (16:42 +0000)
1  2 
includes/DefaultSettings.php
includes/Preferences.php

@@@ -959,23 -959,6 +959,23 @@@ $wgTrustedMediaFormats = 
   */
  $wgMediaHandlers = [];
  
 +/**
 + * Media handler overrides for parser tests (they don't need to generate actual
 + * thumbnails, so a mock will do)
 + */
 +$wgParserTestMediaHandlers = [
 +      'image/jpeg' => 'MockBitmapHandler',
 +      'image/png' => 'MockBitmapHandler',
 +      'image/gif' => 'MockBitmapHandler',
 +      'image/tiff' => 'MockBitmapHandler',
 +      'image/webp' => 'MockBitmapHandler',
 +      'image/x-ms-bmp' => 'MockBitmapHandler',
 +      'image/x-bmp' => 'MockBitmapHandler',
 +      'image/x-xcf' => 'MockBitmapHandler',
 +      'image/svg+xml' => 'MockSvgHandler',
 +      'image/vnd.djvu' => 'MockDjVuHandler',
 +];
 +
  /**
   * Plugins for page content model handling.
   * Each entry in the array maps a model id to a class name or callback
@@@ -1321,7 -1304,7 +1321,7 @@@ $wgMimeInfoFile = 'includes/mime.info'
   * Sets an external MIME detector program. The command must print only
   * the MIME type to standard output.
   * The name of the file to process will be appended to the command given here.
 - * If not set or NULL, PHP's fileinfo extension will be used if available.
 + * If not set or NULL, PHP's mime_content_type function will be used.
   *
   * @par Example:
   * @code
@@@ -3389,56 -3372,16 +3389,56 @@@ $wgApiFrameOptions = 'DENY'
  $wgDisableOutputCompression = false;
  
  /**
 - * Should we allow a broader set of characters in id attributes, per HTML5?  If
 - * not, use only HTML 4-compatible IDs.  This option is for testing -- when the
 - * functionality is ready, it will be on by default with no option.
 + * Abandoned experiment with HTML5-style ID escaping. Normalized IDs a bit
 + * too aggressively, breaking preexisting content (particularly Cite).
 + * See T29733, T29694, T29474.
   *
 - * Currently this appears to work fine in all browsers, but it's disabled by
 - * default because it normalizes id's a bit too aggressively, breaking preexisting
 - * content (particularly Cite).  See T29733, T29694, T29474.
 + * @deprecated since 1.30, use $wgFragmentMode
   */
  $wgExperimentalHtmlIds = false;
  
 +/**
 + * How should section IDs be encoded?
 + * This array can contain 1 or 2 elements, each of them can be one of:
 + * - 'html5'  is modern HTML5 style encoding with minimal escaping. Allows to
 + *            display Unicode characters in many browsers' address bars.
 + * - 'legacy' is old MediaWiki-style encoding, e.g. 啤酒 turns into .E5.95.A4.E9.85.92
 + * - 'html5-legacy' corresponds to DEPRECATED $wgExperimentalHtmlIds mode. DO NOT use
 + *            it for anything but migration off that mode (see below).
 + *
 + * The first element of this array specifies the primary mode of escaping IDs. This
 + * is what users will see when they e.g. follow an [[#internal link]] to a section of
 + * a page.
 + *
 + * The optional second element defines a fallback mode, useful for migrations.
 + * If present, it will direct MediaWiki to add empty <span>s to every section with its
 + * id attribute set to fallback encoded title so that links using the previous encoding
 + * would still work.
 + *
 + * Example: you want to migrate your wiki from 'legacy' to 'html5'
 + *
 + * On the first step, set this variable to [ 'legacy', 'html5' ]. After a while, when
 + * all caches (parser, HTTP, etc.) contain only pages generated with this setting,
 + * flip the value to [ 'html5', 'legacy' ]. This will result in all internal links being
 + * generated in the new encoding while old links (both external and cached internal) will
 + * still work. After a long time, you might want to ditch backwards compatibility and
 + * set it to [ 'html5' ]. After all, pages get edited, breaking incoming links no matter which
 + * fragment mode is used.
 + *
 + * @since 1.30
 + */
 +$wgFragmentMode = [ 'legacy' ];
 +
 +/**
 + * Which ID escaping mode should be used for external interwiki links? See documentation
 + * for $wgFragmentMode above for details of each mode. Because you can't control external sites,
 + * this setting should probably always be 'legacy', unless every wiki you link to has converted
 + * to 'html5'.
 + *
 + * @since 1.30
 + */
 +$wgExternalInterwikiFragmentMode = 'legacy';
 +
  /**
   * Abstract list of footer icons for skins in place of old copyrightico and poweredbyico code
   * You can add new icons to the built in copyright or poweredby, or you can create
@@@ -3811,18 -3754,20 +3811,18 @@@ $wgResourceLoaderValidateStaticJS = fal
   * at the beginning of all your .less files, with all the consequences.
   * In particular, string values must be escaped and quoted.
   *
 - * Changes to LESS variables do not trigger cache invalidation.
 - *
 - * If the LESS variables need to be dynamic, you can use the
 - * ResourceLoaderGetLessVars hook (since 1.25).
 + * Changes to this configuration do NOT trigger cache invalidation.
   *
   * @par Example:
   * @code
   *   $wgResourceLoaderLESSVars = [
 - *     'baseFontSize'  => '1em',
 - *     'smallFontSize' => '0.75em',
 - *     'WikimediaBlue' => '#006699',
 + *     'exampleFontSize'  => '1em',
 + *     'exampleBlue' => '#eee',
   *   ];
   * @endcode
   * @since 1.22
 + * @deprecated since 1.30 Use ResourceLoaderModule::getLessVars() instead to
 + *  add variables to individual modules that need them.
   */
  $wgResourceLoaderLESSVars = [
        /**
@@@ -4146,14 -4091,6 +4146,14 @@@ $wgTrackingCategories = []
   */
  $wgContentNamespaces = [ NS_MAIN ];
  
 +/**
 + * Optional array of namespaces which should be blacklisted from Special:ShortPages
 + * Only pages inside $wgContentNamespaces but not $wgShortPagesNamespaceBlacklist will
 + * be shown on that page.
 + * @since 1.30
 + */
 +$wgShortPagesNamespaceBlacklist = [];
 +
  /**
   * Array of namespaces, in addition to the talk namespaces, where signatures
   * (~~~~) are likely to be used. This determines whether to display the
@@@ -4901,7 -4838,7 +4901,7 @@@ $wgDefaultUserOptions = 
        'date' => 'default',
        'diffonly' => 0,
        'disablemail' => 0,
-       'editfont' => 'default',
+       'editfont' => 'monospace',
        'editondblclick' => 0,
        'editsectiononrightclick' => 0,
        'enotifminoredits' => 0,
        'watchlisthidepatrolled' => 0,
        'watchlisthidecategorization' => 1,
        'watchlistreloadautomatically' => 0,
 +      'watchlistunwatchlinks' => 0,
        'watchmoves' => 0,
        'watchrollback' => 0,
        'wllimit' => 250,
@@@ -5815,7 -5751,7 +5815,7 @@@ $wgPasswordAttemptThrottle = 
        // Long term limit. We need to balance the risk
        // of somebody using this as a DoS attack to lock someone
        // out of their account, and someone doing a brute force attack.
 -      [ 'count' => 150, 'seconds' => 60*60*48 ],
 +      [ 'count' => 150, 'seconds' => 60 * 60 * 48 ],
  ];
  
  /**
@@@ -6835,6 -6771,11 +6835,6 @@@ $wgRCWatchCategoryMembership = false
   */
  $wgUseRCPatrol = true;
  
 -/**
 - * Whether to allow users to save their RecentChanges filters
 - */
 -$wgStructuredChangeFiltersEnableSaving = true;
 -
  /**
   * Whether to show the new experimental views (like namespaces, tags, and users) in
   * RecentChanges filters
@@@ -6846,11 -6787,6 +6846,11 @@@ $wgStructuredChangeFiltersEnableExperim
   */
  $wgStructuredChangeFiltersEnableLiveUpdate = false;
  
 +/**
 + * Whether to enable RCFilters app on Special:Watchlist
 + */
 +$wgStructuredChangeFiltersOnWatchlist = false;
 +
  /**
   * Use new page patrolling to check new pages on Special:Newpages
   */
@@@ -8302,15 -8238,10 +8302,15 @@@ $wgHTTPProxy = false
   * Local virtual hosts.
   *
   * This lists domains that are configured as virtual hosts on the same machine.
 - * If a request is to be made to a domain listed here, or any subdomain thereof,
 - * then no proxy will be used.
 - * Command-line scripts are not affected by this setting and will always use
 - * proxy if it is configured.
 + *
 + * This affects the following:
 + * - MWHttpRequest: If a request is to be made to a domain listed here, or any
 + *   subdomain thereof, then no proxy will be used.
 + *   Command-line scripts are not affected by this setting and will always use
 + *   the proxy if it is configured.
 + * - ChronologyProtector: Decide to shutdown LBFactory asynchronously instead
 + *   synchronously if the current response redirects to a local virtual host.
 + *
   * @since 1.25
   */
  $wgLocalVirtualHosts = [];
diff --combined includes/Preferences.php
@@@ -109,7 -109,7 +109,7 @@@ class Preferences 
         * @throws MWException
         * @param User $user
         * @param IContextSource $context
 -       * @param array $defaultPreferences Array to load values for
 +       * @param array &$defaultPreferences Array to load values for
         * @return array|null
         */
        static function loadPreferenceValues( $user, $context, &$defaultPreferences ) {
        /**
         * @param User $user
         * @param IContextSource $context
 -       * @param array $defaultPreferences
 +       * @param array &$defaultPreferences
         * @return void
         */
        static function profilePreferences( $user, IContextSource $context, &$defaultPreferences ) {
        /**
         * @param User $user
         * @param IContextSource $context
 -       * @param array $defaultPreferences
 +       * @param array &$defaultPreferences
         * @return void
         */
        static function skinPreferences( $user, IContextSource $context, &$defaultPreferences ) {
        /**
         * @param User $user
         * @param IContextSource $context
 -       * @param array $defaultPreferences
 +       * @param array &$defaultPreferences
         */
        static function filesPreferences( $user, IContextSource $context, &$defaultPreferences ) {
                # # Files #####################################
        /**
         * @param User $user
         * @param IContextSource $context
 -       * @param array $defaultPreferences
 +       * @param array &$defaultPreferences
         * @return void
         */
        static function datetimePreferences( $user, IContextSource $context, &$defaultPreferences ) {
        /**
         * @param User $user
         * @param IContextSource $context
 -       * @param array $defaultPreferences
 +       * @param array &$defaultPreferences
         */
        static function renderingPreferences( $user, IContextSource $context, &$defaultPreferences ) {
                # # Diffs ####################################
        /**
         * @param User $user
         * @param IContextSource $context
 -       * @param array $defaultPreferences
 +       * @param array &$defaultPreferences
         */
        static function editingPreferences( $user, IContextSource $context, &$defaultPreferences ) {
                # # Editing #####################################
                                'section' => 'editing/editor',
                                'label-message' => 'editfont-style',
                                'options' => [
-                                       $context->msg( 'editfont-default' )->text() => 'default',
                                        $context->msg( 'editfont-monospace' )->text() => 'monospace',
                                        $context->msg( 'editfont-sansserif' )->text() => 'sans-serif',
                                        $context->msg( 'editfont-serif' )->text() => 'serif',
+                                       $context->msg( 'editfont-default' )->text() => 'default',
                                ]
                        ];
                }
        /**
         * @param User $user
         * @param IContextSource $context
 -       * @param array $defaultPreferences
 +       * @param array &$defaultPreferences
         */
        static function rcPreferences( $user, IContextSource $context, &$defaultPreferences ) {
                $config = $context->getConfig();
                ];
                $defaultPreferences['rclimit'] = [
                        'type' => 'int',
 +                      'min' => 0,
 +                      'max' => 1000,
                        'label-message' => 'recentchangescount',
                        'help-message' => 'prefs-help-recentchangescount',
                        'section' => 'rc/displayrc',
                $defaultPreferences['rcfilters-saved-queries'] = [
                        'type' => 'api',
                ];
 +              $defaultPreferences['rcfilters-wl-saved-queries'] = [
 +                      'type' => 'api',
 +              ];
 +              $defaultPreferences['rcfilters-rclimit'] = [
 +                      'type' => 'api',
 +              ];
  
                if ( $config->get( 'RCWatchCategoryMembership' ) ) {
                        $defaultPreferences['hidecategorization'] = [
        /**
         * @param User $user
         * @param IContextSource $context
 -       * @param array $defaultPreferences
 +       * @param array &$defaultPreferences
         */
        static function watchlistPreferences( $user, IContextSource $context, &$defaultPreferences ) {
                $config = $context->getConfig();
                        'section' => 'watchlist/advancedwatchlist',
                        'label-message' => 'tog-watchlistreloadautomatically',
                ];
 +              $defaultPreferences['watchlistunwatchlinks'] = [
 +                      'type' => 'toggle',
 +                      'section' => 'watchlist/advancedwatchlist',
 +                      'label-message' => 'tog-watchlistunwatchlinks',
 +              ];
  
                if ( $config->get( 'RCWatchCategoryMembership' ) ) {
                        $defaultPreferences['watchlisthidecategorization'] = [
        /**
         * @param User $user
         * @param IContextSource $context
 -       * @param array $defaultPreferences
 +       * @param array &$defaultPreferences
         */
        static function searchPreferences( $user, IContextSource $context, &$defaultPreferences ) {
                foreach ( MWNamespace::getValidNamespaces() as $n ) {
  
        /**
         * Dummy, kept for backwards-compatibility.
 +       * @param User $user
 +       * @param IContextSource $context
 +       * @param array &$defaultPreferences
         */
        static function miscPreferences( $user, IContextSource $context, &$defaultPreferences ) {
        }
                $formClass = 'PreferencesForm',
                array $remove = []
        ) {
 -              $formDescriptor = Preferences::getPreferences( $user, $context );
 +              $formDescriptor = self::getPreferences( $user, $context );
                if ( count( $remove ) ) {
                        $removeKeys = array_flip( $remove );
                        $formDescriptor = array_diff_key( $formDescriptor, $removeKeys );