Merge "Turn ParserCache into a service, deprecate $parserMemc"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Thu, 6 Jul 2017 03:11:51 +0000 (03:11 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Thu, 6 Jul 2017 03:11:51 +0000 (03:11 +0000)
includes/Linker.php
tests/phpunit/includes/LinkerTest.php

index 5845532..f2e4ac4 100644 (file)
@@ -1331,7 +1331,10 @@ class Linker {
                        $link = Linker::makeExternalLink(
                                WikiMap::getForeignURL(
                                        $wikiId,
-                                       $title->getPrefixedText(),
+                                       $title->getNamespace() === 0
+                                               ? $title->getDBkey()
+                                               : MWNamespace::getCanonicalName( $title->getNamespace() ) . ':'
+                                                       . $title->getDBkey(),
                                        $title->getFragment()
                                ),
                                $text,
index 3e3fb0f..f4844f8 100644 (file)
@@ -306,6 +306,11 @@ class LinkerTest extends MediaWikiLangTestCase {
                                'foo bar [[Special:BlankPage]]',
                                'enwiki',
                        ],
+                       [
+                               'foo bar <a class="external" rel="nofollow" href="//en.example.org/w/File:Example">Image:Example</a>',
+                               'foo bar [[Image:Example]]',
+                               'enwiki',
+                       ],
                ];
                // @codingStandardsIgnoreEnd
        }