From 0856c004352a63869b7b58549ac11b71ef1a231b Mon Sep 17 00:00:00 2001 From: raymond Date: Wed, 9 Jan 2013 14:30:25 +0100 Subject: [PATCH] Cleanup HTML of imagepage: avoid empty This happens when a redirect without usages exists While I am in this section: Use modern Html() function Change-Id: I1af206ab3a83fb0d09773314bb30db01f557ba07 --- includes/ImagePage.php | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/includes/ImagePage.php b/includes/ImagePage.php index ae3a08e214..c93f38c7f6 100644 --- a/includes/ImagePage.php +++ b/includes/ImagePage.php @@ -796,9 +796,14 @@ EOT $link = Linker::linkKnown( Title::makeTitle( $element->page_namespace, $element->page_title ) ); if ( !isset( $redirects[$element->page_title] ) ) { + # No redirects $liContents = $link; + } elseif ( count( $redirects[$element->page_title] ) === 0 ) { + # Redirect without usages + $liContents = wfMessage( 'linkstoimage-redirect' )->rawParams( $link, '' )->parse(); } else { - $ul = "'; + + $ul = Html::rawElement( + 'ul', + array( 'class' => 'mw-imagepage-redirectstofile'), + $li + ) . "\n"; $liContents = wfMessage( 'linkstoimage-redirect' )->rawParams( $link, $ul )->parse(); } -- 2.20.1