r101656 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r101655‎ | r101656 | r101657 >
Date:18:47, 2 November 2011
Author:aaron
Status:ok (Comments)
Tags:
Comment:
Alias NS_MEDIA page views to NS_FILE. Fixes bug 32032.
Modified paths:
  • /trunk/phase3/includes/Wiki.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Wiki.php
@@ -78,7 +78,12 @@
7979 $ret = Title::newMainPage();
8080 } else {
8181 $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
8388 // about the possible different language variants
8489 if ( count( $wgContLang->getVariants() ) > 1
8590 && !is_null( $ret ) && $ret->getArticleID() == 0 )

Follow-up revisions

RevisionCommit summaryAuthorDate
r107907MFT r100348, r100640, r101656, r101867, r101869m r104030reedy17:34, 3 January 2012
r107953MFT r100348, r101656, r103450, r103672, r103677, r103679, r103694reedy22:32, 3 January 2012

Comments

#Comment by Bawolff (talk | contribs)   21:59, 5 December 2011

tagging 1.18wmf1 based on bugzilla:32785 (fixes throwing an uncaught exception on urls like http://mediawiki.org/wiki/media:foo?action=edit )

Status & tagging log