Merge "Align "What's this" vertically"
[lhc/web/wiklou.git] / includes / page / ImagePage.php
index 6a751ac..0e3eaa5 100644 (file)
@@ -115,23 +115,11 @@ class ImagePage extends Article {
 
                if ( $this->getTitle()->getNamespace() == NS_FILE && $this->mPage->getFile()->getRedirected() ) {
                        if ( $this->getTitle()->getDBkey() == $this->mPage->getFile()->getName() || $diff !== null ) {
-                               // mTitle is the same as the redirect target so ask Article
-                               // to perform the redirect for us.
                                $request->setVal( 'diffonly', 'true' );
-                               parent::view();
-                               return;
-                       } else {
-                               // mTitle is not the same as the redirect target so it is
-                               // probably the redirect page itself. Fake the redirect symbol
-                               $out->setPageTitle( $this->getTitle()->getPrefixedText() );
-                               $out->addHTML( $this->viewRedirect(
-                                       Title::makeTitle( NS_FILE, $this->mPage->getFile()->getName() ),
-                                       /* $appendSubtitle */ true,
-                                       /* $forceKnown */ true )
-                               );
-                               $this->mPage->doViewUpdates( $this->getContext()->getUser(), $this->getOldID() );
-                               return;
                        }
+
+                       parent::view();
+                       return;
                }
 
                if ( $wgShowEXIF && $this->displayImg->exists() ) {
@@ -266,15 +254,16 @@ class ImagePage extends Article {
                $r .= "<table id=\"mw_metadata\" class=\"mw_metadata\">\n";
                foreach ( $metadata as $type => $stuff ) {
                        foreach ( $stuff as $v ) {
-                               # @todo FIXME: Why is this using escapeId for a class?!
-                               $class = Sanitizer::escapeId( $v['id'] );
+                               $class = str_replace( ' ', '_', $v['id'] );
                                if ( $type == 'collapsed' ) {
                                        // Handled by mediawiki.action.view.metadata module.
                                        $class .= ' collapsable';
                                }
-                               $r .= "<tr class=\"$class\">\n";
-                               $r .= "<th>{$v['name']}</th>\n";
-                               $r .= "<td>{$v['value']}</td>\n</tr>";
+                               $r .= Html::rawElement( 'tr',
+                                       [ 'class' => $class ],
+                                       Html::rawElement( 'th', [], $v['name'] )
+                                               . Html::rawElement( 'td', [], $v['value'] )
+                               );
                        }
                }
                $r .= "</table>\n</div>\n";
@@ -632,8 +621,8 @@ EOT
        /**
         * Make the text under the image to say what size preview
         *
-        * @param $params array parameters for thumbnail
-        * @param $sizeLinkBigImagePreview HTML for the current size
+        * @param array $params parameters for thumbnail
+        * @param string $sizeLinkBigImagePreview HTML for the current size
         * @return string HTML output
         */
        private function getThumbPrevText( $params, $sizeLinkBigImagePreview ) {