Merge "Show dimensions in TraditionalImageGallery"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Thu, 15 Jun 2017 17:16:13 +0000 (17:16 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Thu, 15 Jun 2017 17:16:13 +0000 (17:16 +0000)
1  2 
includes/DefaultSettings.php
includes/parser/Parser.php

@@@ -75,7 -75,7 +75,7 @@@ $wgConfigRegistry = 
   * MediaWiki version number
   * @since 1.2
   */
 -$wgVersion = '1.29.0-alpha';
 +$wgVersion = '1.30.0-alpha';
  
  /**
   * Name of the site. It must be changed in LocalSettings.php
@@@ -1455,6 -1455,8 +1455,8 @@@ $wgGalleryOptions = 
        'captionLength' => true,
        // Show the filesize in bytes in categories
        'showBytes' => true,
+       // Show the dimensions (width x height) in categories
+       'showDimensions' => true,
        'mode' => 'traditional',
  ];
  
@@@ -2825,9 -2827,8 +2827,9 @@@ $wgUsePrivateIPs = false
   * MediaWiki out of the box. Not all languages listed there have translations,
   * see languages/messages/ for the list of languages with some localisation.
   *
 - * Warning: Don't use language codes listed in $wgDummyLanguageCodes like "no"
 - * for Norwegian (use "nb" instead), or things will break unexpectedly.
 + * Warning: Don't use any of MediaWiki's deprecated language codes listed in
 + * LanguageCode::getDeprecatedCodeMapping or $wgDummyLanguageCodes, like "no"
 + * for Norwegian (use "nb" instead). If you do, things will break unexpectedly.
   *
   * This defines the default interface language for all users, but users can
   * change it in their preferences.
@@@ -2886,32 -2887,27 +2888,32 @@@ $wgExtraInterlanguageLinkPrefixes = []
  $wgExtraLanguageNames = [];
  
  /**
 - * List of language codes that don't correspond to an actual language.
 - * These codes are mostly left-offs from renames, or other legacy things.
 - * This array makes them not appear as a selectable language on the installer,
 - * and excludes them when running the transstat.php script.
 - */
 -$wgDummyLanguageCodes = [
 -      'als' => 'gsw',
 -      'bat-smg' => 'sgs',
 -      'be-x-old' => 'be-tarask',
 -      'bh' => 'bho',
 -      'fiu-vro' => 'vro',
 -      'no' => 'nb',
 -      'qqq' => 'qqq', # Used for message documentation.
 -      'qqx' => 'qqx', # Used for viewing message keys.
 -      'roa-rup' => 'rup',
 -      'simple' => 'en',
 -      'zh-classical' => 'lzh',
 -      'zh-min-nan' => 'nan',
 -      'zh-yue' => 'yue',
 + * List of mappings from one language code to another.
 + * This array makes the codes not appear as a selectable language on the
 + * installer, and excludes them when running the transstat.php script.
 + *
 + * In Setup.php, the variable $wgDummyLanguageCodes is created by combining
 + * these codes with a list of "deprecated" codes, which are mostly leftovers
 + * from renames or other legacy things, and the internal codes 'qqq' and 'qqx'.
 + * If a mapping in $wgExtraLanguageCodes collide with a built-in mapping, the
 + * value in $wgExtraLanguageCodes will be used.
 + *
 + * @since 1.29
 + */
 +$wgExtraLanguageCodes = [
 +      'bh' => 'bho', // Bihari language family
 +      'no' => 'nb', // Norwegian language family
 +      'simple' => 'en', // Simple English
  ];
  
 +/**
 + * Functionally the same as $wgExtraLanguageCodes, but deprecated. Instead of
 + * appending values to this array, append them to $wgExtraLanguageCodes.
 + *
 + * @deprecated since 1.29
 + */
 +$wgDummyLanguageCodes = [];
 +
  /**
   * Set this to true to replace Arabic presentation forms with their standard
   * forms in the U+0600-U+06FF block. This only works if $wgLanguageCode is
@@@ -3056,12 -3052,6 +3058,12 @@@ $wgDisableTitleConversion = false
   */
  $wgDefaultLanguageVariant = false;
  
 +/**
 + * Whether to enable the pig latin variant of English (en-x-piglatin),
 + * used to ease variant development work.
 + */
 +$wgUsePigLatinVariant = false;
 +
  /**
   * Disabled variants array of language variant conversion.
   *
@@@ -3222,14 -3212,6 +3224,14 @@@ $wgHTMLFormAllowTableFormat = true
   */
  $wgUseMediaWikiUIEverywhere = false;
  
 +/**
 + * Temporary variable that determines whether the EditPage class should use OOjs UI or not.
 + * This will be removed later and OOjs UI will become the only option.
 + *
 + * @since 1.29
 + */
 +$wgOOUIEditPage = true;
 +
  /**
   * Whether to label the store-to-database-and-show-to-others button in the editor
   * as "Save page"/"Save changes" if false (the default) or, if true, instead as
@@@ -3679,16 -3661,6 +3681,16 @@@ $wgResourceLoaderMinifierMaxLineLength 
   */
  $wgIncludeLegacyJavaScript = false;
  
 +/**
 + * Use jQuery 3 (with jQuery Migrate) instead of jQuery 1.
 + *
 + * This is a temporary feature flag for the MediaWiki 1.29 development cycle while
 + * instabilities with jQuery 3 are being addressed. See T124742.
 + *
 + * @deprecated since 1.29
 + */
 +$wgUsejQueryThree = true;
 +
  /**
   * Whether or not to assign configuration variables to the global window object.
   *
@@@ -4197,7 -4169,7 +4199,7 @@@ $wgMaxPPExpandDepth = 40
   *
   * WARNING: Do not add 'file:' to this or internal file links will be broken.
   * Instead, if you want to support file links, add 'file://'. The same applies
 - * to any other protocols with the same name as a namespace. See bug #44011 for
 + * to any other protocols with the same name as a namespace. See task T46011 for
   * more information.
   *
   * @see wfParseUrl
@@@ -4270,8 -4242,7 +4272,8 @@@ $wgAllowImageTag = false
   *    - RaggettInternalPHP: Use the PECL extension
   *    - RaggettExternal: Shell out to an external binary (tidyBin)
   *    - Html5Depurate: Use external Depurate service
 - *    - Html5Internal: Use the built-in HTML5 balancer
 + *    - Html5Internal: Use the Balancer library in PHP
 + *    - RemexHtml: Use the RemexHtml library in PHP
   *
   *  - tidyConfigFile: Path to configuration file for any of the Raggett drivers
   *  - debugComment: True to add a comment to the output with warning messages
@@@ -5918,6 -5889,15 +5920,6 @@@ $wgBotPasswordsCluster = false
   */
  $wgBotPasswordsDatabase = false;
  
 -/**
 - * Whether to disable user group expiry. This is a transitional feature flag
 - * in accordance with WMF schema change policy, and will be removed later
 - * (hopefully before MW 1.29 release).
 - *
 - * @since 1.29
 - */
 -$wgDisableUserGroupExpiry = false;
 -
  /** @} */ # end of user rights settings
  
  /************************************************************************//**
@@@ -5935,7 -5915,7 +5937,7 @@@ $wgSecretKey = false
   *
   * This can have the following formats:
   * - An array of addresses, either in the values
 - *   or the keys (for backward compatibility)
 + *   or the keys (for backward compatibility, deprecated since 1.30)
   * - A string, in that case this is the path to a file
   *   containing the list of IP addresses, one per line
   */
@@@ -6768,17 -6748,6 +6770,17 @@@ $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
 + */
 +$wgStructuredChangeFiltersEnableExperimentalViews = false;
 +
  /**
   * Use new page patrolling to check new pages on Special:Newpages
   */
@@@ -7340,10 -7309,8 +7342,10 @@@ $wgServiceWiringFiles = 
  ];
  
  /**
 - * Maps jobs to their handling classes; extensions
 - * can add to this to provide custom jobs
 + * Maps jobs to their handlers; extensions
 + * can add to this to provide custom jobs.
 + * A job handler should either be a class name to be instantiated,
 + * or (since 1.30) a callback to use for creating the job object.
   */
  $wgJobClasses = [
        'refreshLinks' => 'RefreshLinksJob',
@@@ -7422,19 -7389,6 +7424,19 @@@ $wgJobQueueAggregator = 
        'class' => 'JobQueueAggregatorNull'
  ];
  
 +/**
 + * Whether to include the number of jobs that are queued
 + * for the API's maxlag parameter.
 + * The total number of jobs will be divided by this to get an
 + * estimated second of maxlag. Typically bots backoff at maxlag=5,
 + * so setting this to the max number of jobs that should be in your
 + * queue divided by 5 should have the effect of stopping bots once
 + * that limit is hit.
 + *
 + * @since 1.29
 + */
 +$wgJobQueueIncludeInMaxLagFactor = false;
 +
  /**
   * Additional functions to be performed with updateSpecialPages.
   * Expensive Querypages are already updated.
@@@ -7443,6 -7397,15 +7445,6 @@@ $wgSpecialPageCacheUpdates = 
        'Statistics' => [ 'SiteStatsUpdate', 'cacheUpdate' ]
  ];
  
 -/**
 - * Hooks that are used for outputting exceptions.  Format is:
 - *   $wgExceptionHooks[] = $funcname
 - * or:
 - *   $wgExceptionHooks[] = [ $class, $funcname ]
 - * Hooks should return strings or false
 - */
 -$wgExceptionHooks = [];
 -
  /**
   * Page property link table invalidation lists. When a page property
   * changes, this may require other link tables to be updated (eg
@@@ -8163,40 -8126,11 +8165,40 @@@ $wgShellCgroup = false
  $wgPhpCli = '/usr/bin/php';
  
  /**
 - * Locale for LC_CTYPE, to work around https://bugs.php.net/bug.php?id=45132
 - * For Unix-like operating systems, set this to to a locale that has a UTF-8
 - * character set. Only the character set is relevant.
 - */
 -$wgShellLocale = 'en_US.utf8';
 + * Locale for LC_ALL, to provide a known environment for locale-sensitive operations
 + *
 + * For Unix-like operating systems, this should be set to C.UTF-8 or an
 + * equivalent to provide the most consistent behavior for locale-sensitive
 + * C library operations across different-language wikis. If that locale is not
 + * available, use another locale that has a UTF-8 character set.
 + *
 + * This setting mainly affects the behavior of C library functions, including:
 + *  - String collation (order when sorting using locale-sensitive comparison)
 + *    - For example, whether "Å" and "A" are considered to be the same letter or
 + *      different letters and if different whether it comes after "A" or after
 + *      "Z", and whether sorting is case sensitive.
 + *  - String character set (how characters beyond basic ASCII are represented)
 + *    - We need this to be a UTF-8 character set to work around
 + *      https://bugs.php.net/bug.php?id=45132
 + *  - Language used for low-level error messages.
 + *  - Formatting of date/time and numeric values (e.g. '.' versus ',' as the
 + *    decimal separator)
 + *
 + * MediaWiki provides its own methods and classes to perform many
 + * locale-sensitive operations, which are designed to be able to vary locale
 + * based on wiki language or user preference:
 + *  - MediaWiki's Collation class should generally be used instead of the C
 + *    library collation functions when locale-sensitive sorting is needed.
 + *  - MediaWiki's Message class should be used for localization of messages
 + *    displayed to the user.
 + *  - MediaWiki's Language class should be used for formatting numeric and
 + *    date/time values.
 + *
 + * @note If multiple wikis are being served from the same process (e.g. the
 + *  same fastCGI or Apache server), this setting must be the same on all those
 + *  wikis.
 + */
 +$wgShellLocale = 'C.UTF-8';
  
  /** @} */ # End shell }
  
@@@ -8571,15 -8505,6 +8573,15 @@@ $wgPopularPasswordFile = __DIR__ . '/..
   */
  $wgMaxUserDBWriteDuration = false;
  
 +/*
 + * Max time (in seconds) a job-generated transaction can spend in writes.
 + * If exceeded, the transaction is rolled back with an error instead of being committed.
 + *
 + * @var int|bool Disabled if false
 + * @since 1.30
 + */
 +$wgMaxJobDBWriteDuration = false;
 +
  /**
   * Mapping of event channels (or channel categories) to EventRelayer configuration.
   *
@@@ -245,7 -245,7 +245,7 @@@ class Parser 
        public $currentRevisionCache;
  
        /**
 -       * @var bool Recursive call protection.
 +       * @var bool|string Recursive call protection.
         * This variable should be treated as if it were private.
         */
        public $mInParse = false;
                                        $this->mTitle->getPrefixedDBkey() );
                        }
                }
 +
 +              # Wrap non-interface parser output in a <div> so it can be targeted
 +              # with CSS (T37247)
 +              $class = $this->mOptions->getWrapOutputClass();
 +              if ( $class !== false && !$this->mOptions->getInterfaceMessage() ) {
 +                      $text = Html::rawElement( 'div', [ 'class' => $class ], $text );
 +              }
 +
                $this->mOutput->setText( $text );
  
                $this->mRevisionId = $oldRevisionId;
                                true, 'free',
                                $this->getExternalLinkAttribs( $url ), $this->mTitle );
                        # Register it in the output object...
 -                      # Replace unnecessary URL escape codes with their equivalent characters
 -                      $pasteurized = self::normalizeLinkUrl( $url );
 -                      $this->mOutput->addExternalLink( $pasteurized );
 +                      $this->mOutput->addExternalLink( $url );
                }
                return $text . $trail;
        }
                                $this->getExternalLinkAttribs( $url ), $this->mTitle ) . $dtrail . $trail;
  
                        # Register link in the output object.
 -                      # Replace unnecessary URL escape codes with the referenced character
 -                      # This prevents spammers from hiding links from the filters
 -                      $pasteurized = self::normalizeLinkUrl( $url );
 -                      $this->mOutput->addExternalLink( $pasteurized );
 +                      $this->mOutput->addExternalLink( $url );
                }
  
                return $s;
                                $text = '<span class="error">'
                                        . wfMessage( 'parser-template-loop-warning', $titleText )->inContentLanguage()->text()
                                        . '</span>';
 +                              $this->addTrackingCategory( 'template-loop-category' );
                                wfDebug( __METHOD__ . ": template loop broken at '$titleText'\n" );
                        }
                }
  
                if ( !$title->equals( $cacheTitle ) ) {
                        $this->mTplRedirCache[$cacheTitle->getPrefixedDBkey()] =
 -                              [ $title->getNamespace(), $cdb = $title->getDBkey() ];
 +                              [ $title->getNamespace(), $title->getDBkey() ];
                }
  
                return [ $dom, $title ];
                        $toc = Linker::tocList( $toc, $this->mOptions->getUserLangObj() );
                        $this->mOutput->setTOCHTML( $toc );
                        $toc = self::TOC_START . $toc . self::TOC_END;
 -                      $this->mOutput->addModules( 'mediawiki.toc' );
                }
  
                if ( $isMain ) {
  
                $ig->setContextTitle( $this->mTitle );
                $ig->setShowBytes( false );
+               $ig->setShowDimensions( false );
                $ig->setShowFilename( false );
                $ig->setParser( $this );
                $ig->setHideBadImages();
 -              $ig->setAttributes( Sanitizer::validateTagAttributes( $params, 'table' ) );
 +              $ig->setAttributes( Sanitizer::validateTagAttributes( $params, 'ul' ) );
  
                if ( isset( $params['showfilename'] ) ) {
                        $ig->setShowFilename( true );
                                                        }
                                                        if ( preg_match( "/^($prots)$addr$chars*$/u", $linkValue ) ) {
                                                                $link = $linkValue;
 +                                                              $this->mOutput->addExternalLink( $link );
                                                        } else {
                                                                $localLinkTitle = Title::newFromText( $linkValue );
                                                                if ( $localLinkTitle !== null ) {
 +                                                                      $this->mOutput->addLink( $localLinkTitle );
                                                                        $link = $localLinkTitle->getLinkURL();
                                                                }
                                                        }
                                $internalParamMap = [];
                                foreach ( $internalParamNames as $type => $names ) {
                                        foreach ( $names as $name ) {
 +                                              // For grep: img_left, img_right, img_center, img_none,
 +                                              // img_baseline, img_sub, img_super, img_top, img_text_top, img_middle,
 +                                              // img_bottom, img_text_bottom,
 +                                              // img_thumbnail, img_manualthumb, img_framed, img_frameless, img_upright,
 +                                              // img_border, img_link, img_alt, img_class
                                                $magicName = str_replace( '-', '_', "img_$name" );
                                                $internalParamMap[$magicName] = [ $type, $name ];
                                        }
        protected function lock() {
                if ( $this->mInParse ) {
                        throw new MWException( "Parser state cleared while parsing. "
 -                              . "Did you call Parser::parse recursively?" );
 +                              . "Did you call Parser::parse recursively? Lock is held by: " . $this->mInParse );
                }
 -              $this->mInParse = true;
 +
 +              // Save the backtrace when locking, so that if some code tries locking again,
 +              // we can print the lock owner's backtrace for easier debugging
 +              $e = new Exception;
 +              $this->mInParse = $e->getTraceAsString();
  
                $recursiveCheck = new ScopedCallback( function() {
                        $this->mInParse = false;