r44974 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r44973‎ | r44974 | r44975 >
Date:21:12, 23 December 2008
Author:aaron
Status:ok
Tags:
Comment:
(Bug 16678) localurl/fullurl for Media: titles should return the File: title's path
Modified paths:
  • /trunk/phase3/includes/parser/CoreParserFunctions.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/parser/CoreParserFunctions.php
@@ -126,8 +126,12 @@
127127 # attempt, url-decode and try for a second.
128128 if( is_null( $title ) )
129129 $title = Title::newFromUrl( urldecode( $s ) );
130 - if ( !is_null( $title ) ) {
131 - if ( !is_null( $arg ) ) {
 130+ if( !is_null( $title ) ) {
 131+ # Convert NS_MEDIA -> NS_FILE
 132+ if( $title->getNamespace() == NS_MEDIA ) {
 133+ $title = Title::makeTitle( NS_FILE, $title->getDBKey() );
 134+ }
 135+ if( !is_null( $arg ) ) {
132136 $text = $title->$func( $arg );
133137 } else {
134138 $text = $title->$func();

Status & tagging log