From: Aaron Schulz Date: Tue, 23 Dec 2008 21:12:43 +0000 (+0000) Subject: (Bug 16678) localurl/fullurl for Media: titles should return the File: title's path X-Git-Tag: 1.31.0-rc.0~43810 X-Git-Url: https://git.cyclocoop.org/%7B%24admin_url%7Dcompta/operations/modifier.php?a=commitdiff_plain;h=cacf9729064835c93bbe8a41c782a5f2dba6f569;p=lhc%2Fweb%2Fwiklou.git (Bug 16678) localurl/fullurl for Media: titles should return the File: title's path --- 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();