mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/ImageMap
synced 2024-11-15 10:25:09 +00:00
* (bug 12651) Don't record special:, media:, and interwiki links in ImageMap in the internal link tables
This commit is contained in:
parent
bc22c2501e
commit
acf2a86d63
|
@ -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 );
|
||||||
|
|
Loading…
Reference in a new issue