r65203 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r65202‎ | r65203 | r65204 >
Date:00:39, 18 April 2010
Author:brion
Status:ok
Tags:
Comment:
Cleanup for bugs in r65104 (iwlinks table), that'll teach me not to commit at 4am after drinking with the wikimedia devs!
Modified paths:
  • /trunk/phase3/includes/parser/LinkHolderArray.php (modified) (history)
  • /trunk/phase3/includes/parser/Parser.php (modified) (history)
  • /trunk/phase3/includes/parser/ParserOutput.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/parser/LinkHolderArray.php
@@ -162,9 +162,6 @@
163163 # Check if it's a static known link, e.g. interwiki
164164 if ( $title->isAlwaysKnown() ) {
165165 $colours[$pdbk] = '';
166 - if( $title->getInterwiki() != '' ) {
167 - $output->addInterwikiLink( $title );
168 - }
169166 } elseif ( ( $id = $linkCache->getGoodLinkID( $pdbk ) ) != 0 ) {
170167 $colours[$pdbk] = $sk->getLinkColour( $title, $threshold );
171168 $output->addLink( $title, $id );
@@ -269,9 +266,11 @@
270267 wfProfileIn( __METHOD__ );
271268 # Make interwiki link HTML
272269 $sk = $this->parent->getOptions()->getSkin();
 270+ $output = $this->parent->getOutput();
273271 $replacePairs = array();
274272 foreach( $this->interwikis as $key => $link ) {
275273 $replacePairs[$key] = $sk->link( $link['title'], $link['text'] );
 274+ $output->addInterwikiLink( $link['title'] );
276275 }
277276 $replacer = new HashtableReplacer( $replacePairs, 1 );
278277
Index: trunk/phase3/includes/parser/Parser.php
@@ -1830,7 +1830,7 @@
18311831 #
18321832 # FIXME: isAlwaysKnown() can be expensive for file links; we should really do
18331833 # batch file existence checks for NS_FILE and NS_MEDIA
1834 - if ( $iw = '' && $nt->isAlwaysKnown() ) {
 1834+ if ( $iw == '' && $nt->isAlwaysKnown() ) {
18351835 $this->mOutput->addLink( $nt );
18361836 $s .= $this->makeKnownLinkHolder( $nt, $text, '', $trail, $prefix );
18371837 } else {
Index: trunk/phase3/includes/parser/ParserOutput.php
@@ -105,7 +105,6 @@
106106 * @param mixed $id optional known page_id so we can skip the lookup
107107 */
108108 function addLink( $title, $id = null ) {
109 - wfDebug(__METHOD__ . " got: " . $title->getPrefixedText() . "\n");
110109 if ( $title->isExternal() ) {
111110 // Don't record interwikis in pagelinks
112111 $this->addInterwikiLink( $title );

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r65104* (bug 14473) Add iwlinks table to track inline interwiki link usage...brion01:40, 16 April 2010

Status & tagging log