From: raymond Date: Wed, 9 Jan 2013 13:30:25 +0000 (+0100) Subject: Cleanup HTML of imagepage: avoid empty X-Git-Tag: 1.31.0-rc.0~21037 X-Git-Url: https://git.cyclocoop.org/admin/%7B%24plugin.url%7Cescape%7D?a=commitdiff_plain;h=0856c004352a63869b7b58549ac11b71ef1a231b;p=lhc%2Fweb%2Fwiklou.git 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 --- 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(); }