Merge "prop=duplicatefiles does not show duplicates under same name"
[lhc/web/wiklou.git] / includes / SkinLegacy.php
index e1ec897..4a1c699 100644 (file)
@@ -95,7 +95,7 @@ class LegacyTemplate extends BaseTemplate {
        }
 
        /**
-        * This will be called immediately after the <body> tag.  Split into
+        * This will be called immediately after the "<body>" tag.  Split into
         * two functions to make it easier to subclass.
         * @return string
         */
@@ -159,8 +159,8 @@ class LegacyTemplate extends BaseTemplate {
        }
 
        /**
-        * This gets called shortly before the </body> tag.
-        * @return String HTML to be put before </body>
+        * This gets called shortly before the "</body>" tag.
+        * @return String HTML to be put before "</body>"
         */
        function afterContent() {
                return $this->doAfterContent();
@@ -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() );
+
                                }
                        }
                }
@@ -638,7 +638,7 @@ class LegacyTemplate extends BaseTemplate {
                $title = $this->getSkin()->getTitle();
 
                if ( $wgOut->isArticleRelated() ) {
-                       if ( $title->userIsWatching() ) {
+                       if ( $wgUser->isWatched( $title ) ) {
                                $text = wfMsg( 'unwatchthispage' );
                                $query = array(
                                        'action' => 'unwatch',