Index: trunk/phase3/includes/Wiki.php |
— | — | @@ -78,7 +78,12 @@ |
79 | 79 | $ret = Title::newMainPage(); |
80 | 80 | } else { |
81 | 81 | $ret = Title::newFromURL( $title ); |
82 | | - // check variant links so that interwiki links don't have to worry |
| 82 | + // Alias NS_MEDIA page URLs to NS_FILE...we only use NS_MEDIA |
| 83 | + // in wikitext links to tell Parser to make a direct file link |
| 84 | + if ( !is_null( $ret ) && $ret->getNamespace() == NS_MEDIA ) { |
| 85 | + $ret = Title::makeTitle( NS_FILE, $ret->getDBkey() ); |
| 86 | + } |
| 87 | + // Check variant links so that interwiki links don't have to worry |
83 | 88 | // about the possible different language variants |
84 | 89 | if ( count( $wgContLang->getVariants() ) > 1 |
85 | 90 | && !is_null( $ret ) && $ret->getArticleID() == 0 ) |