* (bug 12651) Don't record special:, media:, and interwiki links in ImageMap in the internal link tables

This commit is contained in:
Brion Vibber 2008-01-16 06:08:01 +00:00
parent bc22c2501e
commit acf2a86d63

View file

@ -292,8 +292,16 @@ class ImageMap {
# Register links # Register links
$parser->mOutput->addImage( $imageTitle->getDBkey() ); $parser->mOutput->addImage( $imageTitle->getDBkey() );
foreach ( $links as $title ) { foreach ( $links as $title ) {
if( $title->isExternal() || $title->getNamespace() == NS_SPECIAL ) {
// Don't register special or interwiki links...
} elseif( $title->getNamespace() == NS_MEDIA ) {
// Regular Media: links are recorded as image usages
$parser->mOutput->addImage( $title->getDBkey() );
} else {
// Plain ol' link
$parser->mOutput->addLink( $title ); $parser->mOutput->addLink( $title );
} }
}
if ( isset( $extLinks ) ) { if ( isset( $extLinks ) ) {
foreach ( $extLinks as $title ) { foreach ( $extLinks as $title ) {
$parser->mOutput->addExternalLink( $title ); $parser->mOutput->addExternalLink( $title );