From 43c5dfe9803f5170d3f1034adf6fd50d86d0c3ef Mon Sep 17 00:00:00 2001 From: Jens Frank Date: Fri, 16 Jan 2004 18:11:47 +0000 Subject: [PATCH] Fixed problem with image pages of non existing images --- includes/ImagePage.php | 20 +++++++++++--------- includes/Skin.php | 2 +- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/includes/ImagePage.php b/includes/ImagePage.php index c883bf75f2..e644549dd0 100644 --- a/includes/ImagePage.php +++ b/includes/ImagePage.php @@ -30,18 +30,20 @@ class ImagePage extends Article { $name = $this->mTitle->getText(); $path = wfImagePath( $name ); $url = wfImageUrl( $name ); - - list($width, $height, $type, $attr) = getimagesize( $path ); - $sk = $wgUser->getSkin(); + if ( file_exists( $path ) ) { + list($width, $height, $type, $attr) = getimagesize( $path ); - if ( $type != "" ) { - # image - $s .= "
"; - } else { - $s .= "
".$sk->makeMediaLink($name,"")."
"; + $sk = $wgUser->getSkin(); + + if ( $type != "" ) { + # image + $s .= "
"; + } else { + $s .= "
".$sk->makeMediaLink($name,"")."
"; + } + $wgOut->AddHTML( $s ); } - $wgOut->AddHTML( $s ); } function closeShowImage() diff --git a/includes/Skin.php b/includes/Skin.php index 12111820e4..e0416f47e8 100644 --- a/includes/Skin.php +++ b/includes/Skin.php @@ -1515,7 +1515,7 @@ class Skin { $thumbPath = wfImageArchiveDir( $thumbName, "thumb" )."/".$thumbName; $thumbUrl = wfImageArchiveUrl( $thumbName, "thumb" ); - if ( (! file_exists( $thumbPath )) + if ( (! file_exists( $thumbPath ) && file_exists( $imgPath )) || ( filemtime($thumbPath) < filemtime($imgPath) ) ) { if ( $wgUseImageMagick ) { # use ImageMagick -- 2.20.1