Merge "Don't include images/categories when behind a local interwiki prefix"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Sat, 9 Aug 2014 11:51:07 +0000 (11:51 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Sat, 9 Aug 2014 11:51:07 +0000 (11:51 +0000)
1  2 
RELEASE-NOTES-1.24
includes/Title.php
includes/parser/Parser.php

diff --combined RELEASE-NOTES-1.24
@@@ -45,8 -45,6 +45,8 @@@ production
  * The UserCryptPassword and UserComparePassword hooks are no longer called. Any extensions
    using them must be updated to use the Password Hashing API.
  * $wgCompiledFiles has been removed.
 +* $wgSortSpecialPages was removed, the listing on Special:SpecialPages is
 +  now always sorted.
  
  === New features in 1.24 ===
  * Added a new hook, "WhatLinksHereProps", to allow extensions to annotate
  * (bug 66440) The MediaWiki web installer will now allow you to choose the skins
    to enable (from the ones included in download tarball) and decide which one
    should be the default.
- * (bug 68085) Links of the form [[localInterwikiPrefix:languageCode:pageTitle]],
+ * (bug 68085, 68802) Links like [[localInterwikiPrefix:languageCode:pageTitle]],
    where localInterwikiPrefix is a member of the $wgLocalInterwikis array, will
-   no longer be displayed in the sidebar when $wgInterwikiMagic is true.
+   no longer be displayed in the sidebar when $wgInterwikiMagic is true. In a
+   similar way, links like [[localInterwikiPrefix:File:Image.png]] and
+   [[localInterwikiPrefix:Category:Hello]] will now render as regular links, and
+   will not include the file or add the page to the category.
  * New special page, MyLanguages, to redirect users to subpages with localised
    versions of a page. (Integrated from Extension:Translate)
  * MediaWiki now supports multiple password types, including bcrypt and PBKDF2.
    the $wgResourceModuleSkinStyles global. See the Vector skin for examples.
  * (bug 4488) There is now a preference to watch pages where the user has
    rollbacked an edit by default.
 +* (bug 15484) Users will now be redirected to the login page when they need to
 +  log in, rather than being shown a page asking them to log in and having to click
 +  another link to actually get to the login page.
 +* A JSONContent and JSONContentHandler were added for extensions to extend.
  
  === Bug fixes in 1.24 ===
  * (bug 49116) Footer copyright notice is now always displayed in user language
  * (bug 60734) Actions that use ApiPageSet (e.g. purge, watch,
    setnotificationtimestamp) will now include continuation information when
    using a generator.
 +* $wgAPIModules (and the related $wgAPIFormatModules, $wgAPIMetaModules,
 +  $wgAPIPropModules, and $wgAPIListModules settings) now allow API modules
 +  to be specified using a "module spec" array instead of a plain class name.
 +  A "module spec" is an associative array containing at least the 'class' key
 +  for the module's class, and optionally a 'factory' key for the factory function
 +  to use for the module. This is intended for extensions that want control over
 +  the instantiation of their API modules, to allow for proper dependency
 +  injection.
  
  === Languages updated in 1.24 ===
  
@@@ -305,10 -294,6 +308,10 @@@ changes to languages because of Bugzill
    setPreloadedText() from EditPage.php. (deprecated since 1.21)
  * Removed global functions wfArrayLookup(), wfArrayMerge(), wfDebugDieBacktrace()
    and wfTime(). (deprecated since 1.22)
 +* Microsoft Internet Explorer 6 is now a "grade C" browser, meaning that
 +  JavaScript is no longer executed in this browser. The IEFixes script, which
 +  existed purely to provide support for MSIE versions below 7 and which was
 +  conditionally loaded for those browsers, was also removed.
  
  ==== Renamed classes ====
  * CLDRPluralRuleConverter_Expression to CLDRPluralRuleConverterExpression
diff --combined includes/Title.php
@@@ -74,6 -74,9 +74,9 @@@ class Title 
        /** @var string Interwiki prefix */
        public $mInterwiki = '';
  
+       /** @var bool Was this Title created from a string with a local interwiki prefix? */
+       private $mLocalInterwiki = false;
        /** @var string Title fragment (i.e. the bit after the #) */
        public $mFragment = '';
  
                return $this->mInterwiki;
        }
  
+       /**
+        * Was this a local interwiki link?
+        *
+        * @return bool
+        */
+       public function wasLocalInterwiki() {
+               return $this->mLocalInterwiki;
+       }
        /**
         * Determine whether the object refers to a page within
         * this project and is transcludable.
         * $wgServer is prepended to make an absolute URL.
         *
         * @see self::getFullURL to always get an absolute URL.
 +       * @see self::getLinkURL to always get a URL that's the simplest URL that will be
 +       *  valid to link, locally, to the current Title.
         * @see self::newFromText to produce a Title object.
         *
         * @param string|array $query An optional query string,
                # Fill fields
                $this->setFragment( '#' . $parts['fragment'] );
                $this->mInterwiki = $parts['interwiki'];
+               $this->mLocalInterwiki = $parts['local_interwiki'];
                $this->mNamespace = $parts['namespace'];
                $this->mUserCaseDBKey = $parts['user_case_dbkey'];
  
@@@ -843,7 -843,7 +843,7 @@@ class Parser 
         * @since 1.19
         *
         * @throws MWException
 -       * @return Language|null
 +       * @return Language
         */
        public function getTargetLanguage() {
                $target = $this->mOptions->getTargetLanguage();
                        }
  
                        # Link not escaped by : , create the various objects
-                       if ( $noforce ) {
+                       if ( $noforce && !$nt->wasLocalInterwiki() ) {
                                # Interwikis
                                wfProfileIn( __METHOD__ . "-interwiki" );
-                               # The final condition here is due to bug 68085
                                if (
                                        $iw && $this->mOptions->getInterwikiMagic() && $nottalk && (
                                                Language::fetchLanguageName( $iw, null, 'mw' ) ||
                                                in_array( $iw, $wgExtraInterlanguageLinkPrefixes )
-                                       ) && substr_compare( $this->getTargetLanguage()->lc( ltrim( $origLink ) ),
-                                               $iw, 0, strlen( $iw ) ) === 0
+                                       )
                                ) {
                                        # Bug 24502: filter duplicates
                                        if ( !isset( $this->mLangLinkLanguages[$iw] ) ) {