Update SkinLegacy to use newer methods to create the file link.
authorAlexandre Emsenhuber <ialex.wiki@gmail.com>
Mon, 23 Jul 2012 21:06:08 +0000 (23:06 +0200)
committerAlexandre Emsenhuber <ialex.wiki@gmail.com>
Tue, 24 Jul 2012 12:41:09 +0000 (14:41 +0200)
Linker::getInternalLinkAttributes() is an horrible old thing that I
would like to deprecate, and that's the last usage of it I could find.

Change-Id: Icbda801bf8240cf2e4e23d6b99406e3a909e9d0b

includes/SkinLegacy.php

index 6385250..4a1c699 100644 (file)
@@ -446,13 +446,13 @@ class LegacyTemplate extends BaseTemplate {
 
                if ( $wgOut->isArticleRelated() ) {
                        if ( $title->getNamespace() == NS_FILE ) {
-                               $name = $title->getDBkey();
                                $image = wfFindFile( $title );
 
                                if ( $image ) {
-                                       $link = htmlspecialchars( $image->getURL() );
-                                       $style = Linker::getInternalLinkAttributes( $link, $name );
-                                       $s[] = "<a href=\"{$link}\"{$style}>{$name}</a>";
+                                       $href = $image->getURL();
+                                       $s[] = Html::element( 'a', array( 'href' => $href,
+                                               'title' => $href ), $title->getText() );
+
                                }
                        }
                }