From 95ef1b6fd6f6462e25436fdb150331ddaa5ce80b Mon Sep 17 00:00:00 2001 From: Alex Z Date: Sat, 18 Jul 2009 22:49:31 +0000 Subject: [PATCH] (bug 19814) - Interwiki links from file links - [[File:Foo.jpg|link=de:Test]] - are no longer recorded in the pagelinks table Also update Parser::makeImage() docs for the link option --- RELEASE-NOTES | 2 ++ includes/parser/Parser.php | 1 + includes/parser/ParserOutput.php | 4 ++++ 3 files changed, 7 insertions(+) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 8918bd0a4e..ed2a513f60 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -287,6 +287,8 @@ this. Was used when mwEmbed was going to be an extension. database type * (bug 19759) successbox on Special:Preferences now correctly aligned on standard, nostalgia and cologneblue skin +* (bug 19814) interwiki links from file links ([[File:Foo.jpg|link=de:Test]]) + are no longer recorded in the pagelinks table == API changes in 1.16 == diff --git a/includes/parser/Parser.php b/includes/parser/Parser.php index 5a674c5052..7f71aba312 100644 --- a/includes/parser/Parser.php +++ b/includes/parser/Parser.php @@ -4432,6 +4432,7 @@ class Parser # * upright reduce width for upright images, rounded to full __0 px # * border draw a 1px border around the image # * alt Text for HTML alt attribute (defaults to empty) + # * link Set the target of the image link. Can be external, interwiki, or local # vertical-align values (no % or length right now): # * baseline # * sub diff --git a/includes/parser/ParserOutput.php b/includes/parser/ParserOutput.php index 1b9ebf4872..38d21fb55b 100644 --- a/includes/parser/ParserOutput.php +++ b/includes/parser/ParserOutput.php @@ -101,6 +101,10 @@ class ParserOutput } function addLink( $title, $id = null ) { + if ( $title->isExternal() ) { + // Don't record interwikis in pagelinks + return; + } $ns = $title->getNamespace(); $dbk = $title->getDBkey(); if ( $ns == NS_MEDIA ) { -- 2.20.1