From e1d14043720e210dd5117ad882b5b8c4383fa425 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Sun, 18 Apr 2010 00:39:12 +0000 Subject: [PATCH] Cleanup for bugs in r65104 (iwlinks table), that'll teach me not to commit at 4am after drinking with the wikimedia devs! --- includes/parser/LinkHolderArray.php | 5 ++--- includes/parser/Parser.php | 2 +- includes/parser/ParserOutput.php | 1 - 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/includes/parser/LinkHolderArray.php b/includes/parser/LinkHolderArray.php index 3fa88bca8f..00e5ef5b97 100644 --- a/includes/parser/LinkHolderArray.php +++ b/includes/parser/LinkHolderArray.php @@ -162,9 +162,6 @@ class LinkHolderArray { # Check if it's a static known link, e.g. interwiki if ( $title->isAlwaysKnown() ) { $colours[$pdbk] = ''; - if( $title->getInterwiki() != '' ) { - $output->addInterwikiLink( $title ); - } } elseif ( ( $id = $linkCache->getGoodLinkID( $pdbk ) ) != 0 ) { $colours[$pdbk] = $sk->getLinkColour( $title, $threshold ); $output->addLink( $title, $id ); @@ -269,9 +266,11 @@ class LinkHolderArray { wfProfileIn( __METHOD__ ); # Make interwiki link HTML $sk = $this->parent->getOptions()->getSkin(); + $output = $this->parent->getOutput(); $replacePairs = array(); foreach( $this->interwikis as $key => $link ) { $replacePairs[$key] = $sk->link( $link['title'], $link['text'] ); + $output->addInterwikiLink( $link['title'] ); } $replacer = new HashtableReplacer( $replacePairs, 1 ); diff --git a/includes/parser/Parser.php b/includes/parser/Parser.php index 2b9cbefda8..8a59b65bc0 100644 --- a/includes/parser/Parser.php +++ b/includes/parser/Parser.php @@ -1830,7 +1830,7 @@ class Parser { # # FIXME: isAlwaysKnown() can be expensive for file links; we should really do # batch file existence checks for NS_FILE and NS_MEDIA - if ( $iw = '' && $nt->isAlwaysKnown() ) { + if ( $iw == '' && $nt->isAlwaysKnown() ) { $this->mOutput->addLink( $nt ); $s .= $this->makeKnownLinkHolder( $nt, $text, '', $trail, $prefix ); } else { diff --git a/includes/parser/ParserOutput.php b/includes/parser/ParserOutput.php index 4c259f2fe9..9cbcfee599 100644 --- a/includes/parser/ParserOutput.php +++ b/includes/parser/ParserOutput.php @@ -105,7 +105,6 @@ class ParserOutput * @param mixed $id optional known page_id so we can skip the lookup */ function addLink( $title, $id = null ) { - wfDebug(__METHOD__ . " got: " . $title->getPrefixedText() . "\n"); if ( $title->isExternal() ) { // Don't record interwikis in pagelinks $this->addInterwikiLink( $title ); -- 2.20.1