r29833 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r29832‎ | r29833 | r29834 >
Date:06:08, 16 January 2008
Author:brion
Status:old
Tags:
Comment:
* (bug 12651) Don't record special:, media:, and interwiki links in ImageMap in the internal link tables
Modified paths:
  • /trunk/extensions/ImageMap/ImageMap_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/ImageMap/ImageMap_body.php
@@ -292,7 +292,15 @@
293293 # Register links
294294 $parser->mOutput->addImage( $imageTitle->getDBkey() );
295295 foreach ( $links as $title ) {
296 - $parser->mOutput->addLink( $title );
 296+ if( $title->isExternal() || $title->getNamespace() == NS_SPECIAL ) {
 297+ // Don't register special or interwiki links...
 298+ } elseif( $title->getNamespace() == NS_MEDIA ) {
 299+ // Regular Media: links are recorded as image usages
 300+ $parser->mOutput->addImage( $title->getDBkey() );
 301+ } else {
 302+ // Plain ol' link
 303+ $parser->mOutput->addLink( $title );
 304+ }
297305 }
298306 if ( isset( $extLinks ) ) {
299307 foreach ( $extLinks as $title ) {

Follow-up revisions

RevisionCommit summaryAuthorDate
r29834Don't register internal links for specials or interwikis on #ifexist lookup....brion06:16, 16 January 2008

Status & tagging log