From: Brion Vibber Date: Sun, 5 Dec 2004 18:54:49 +0000 (+0000) Subject: * (bug 1010) fix broken Commons image link on Classic & Cologne Blue X-Git-Tag: 1.5.0alpha1~1150 X-Git-Url: http://git.cyclocoop.org/%24href?a=commitdiff_plain;h=8365a6f1dedd0787df34c9057667d2affe748065;p=lhc%2Fweb%2Fwiklou.git * (bug 1010) fix broken Commons image link on Classic & Cologne Blue --- diff --git a/includes/Skin.php b/includes/Skin.php index 186a883d36..4f3d0fe0e6 100644 --- a/includes/Skin.php +++ b/includes/Skin.php @@ -534,9 +534,12 @@ class Skin { if ( $wgOut->isArticleRelated() ) { if ( $wgTitle->getNamespace() == Namespace::getImage() ) { $name = $wgTitle->getDBkey(); - $link = htmlspecialchars( Image::wfImageUrl( $name ) ); - $style = $this->getInternalLinkAttributes( $link, $name ); - $s .= " | {$name}"; + $image = new Image( $wgTitle->getDBkey() ); + if( $image->exists() ) { + $link = htmlspecialchars( $image->getURL() ); + $style = $this->getInternalLinkAttributes( $link, $name ); + $s .= " | {$name}"; + } } # This will show the "Approve" link if $wgUseApproval=true; if ( isset ( $wgUseApproval ) && $wgUseApproval )