From 00f77472b4c3ec5ba76505cda17eb8aa6d91b082 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Mon, 31 May 2004 23:50:30 +0000 Subject: [PATCH] If image is missing (or not an image file), move on silently --- includes/Image.php | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/includes/Image.php b/includes/Image.php index d0293a5443..27eeb9d72e 100644 --- a/includes/Image.php +++ b/includes/Image.php @@ -35,16 +35,17 @@ class Image if ( $this->fileExists = file_exists( $this->imagePath ) ) // Sic!, "=" is intended { - $gis = getimagesize( $this->imagePath ); - $this->width = $gis[0]; - $this->height = $gis[1]; - $this->type = $gis[2]; - $this->attr = $gis[3]; - if ( isset( $gis["bits"] ) ) - { - $this->bits = $gis["bits"]; - } else { - $this->bits = 0; + @$gis = getimagesize( $this->imagePath ); + if( $gis !== false ) { + $this->width = $gis[0]; + $this->height = $gis[1]; + $this->type = $gis[2]; + $this->attr = $gis[3]; + if ( isset( $gis["bits"] ) ) { + $this->bits = $gis["bits"]; + } else { + $this->bits = 0; + } } } $this->historyLine = 0; -- 2.20.1