From cacf9729064835c93bbe8a41c782a5f2dba6f569 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Tue, 23 Dec 2008 21:12:43 +0000 Subject: [PATCH] (Bug 16678) localurl/fullurl for Media: titles should return the File: title's path --- includes/parser/CoreParserFunctions.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/includes/parser/CoreParserFunctions.php b/includes/parser/CoreParserFunctions.php index 05b4fe97b9..a3b5189a31 100644 --- a/includes/parser/CoreParserFunctions.php +++ b/includes/parser/CoreParserFunctions.php @@ -126,8 +126,12 @@ class CoreParserFunctions { # attempt, url-decode and try for a second. if( is_null( $title ) ) $title = Title::newFromUrl( urldecode( $s ) ); - if ( !is_null( $title ) ) { - if ( !is_null( $arg ) ) { + if( !is_null( $title ) ) { + # Convert NS_MEDIA -> NS_FILE + if( $title->getNamespace() == NS_MEDIA ) { + $title = Title::makeTitle( NS_FILE, $title->getDBKey() ); + } + if( !is_null( $arg ) ) { $text = $title->$func( $arg ); } else { $text = $title->$func(); -- 2.20.1