From 8365a6f1dedd0787df34c9057667d2affe748065 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Sun, 5 Dec 2004 18:54:49 +0000 Subject: [PATCH] * (bug 1010) fix broken Commons image link on Classic & Cologne Blue --- includes/Skin.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) 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 ) -- 2.20.1