Cleanup for bugs in r65104 (iwlinks table), that'll teach me not to commit at 4am...
authorBrion Vibber <brion@users.mediawiki.org>
Sun, 18 Apr 2010 00:39:12 +0000 (00:39 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Sun, 18 Apr 2010 00:39:12 +0000 (00:39 +0000)
includes/parser/LinkHolderArray.php
includes/parser/Parser.php
includes/parser/ParserOutput.php

index 3fa88bc..00e5ef5 100644 (file)
@@ -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 );
 
index 2b9cbef..8a59b65 100644 (file)
@@ -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 {
index 4c259f2..9cbcfee 100644 (file)
@@ -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 );