From: Brion Vibber Date: Mon, 31 May 2004 23:50:30 +0000 (+0000) Subject: If image is missing (or not an image file), move on silently X-Git-Tag: 1.5.0alpha1~3106 X-Git-Url: http://git.cyclocoop.org//%27http:/code.google.com/p/ie7-js//%27?a=commitdiff_plain;h=00f77472b4c3ec5ba76505cda17eb8aa6d91b082;p=lhc%2Fweb%2Fwiklou.git If image is missing (or not an image file), move on silently --- 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;