If image is missing (or not an image file), move on silently
authorBrion Vibber <brion@users.mediawiki.org>
Mon, 31 May 2004 23:50:30 +0000 (23:50 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Mon, 31 May 2004 23:50:30 +0000 (23:50 +0000)
includes/Image.php

index d0293a5..27eeb9d 100644 (file)
@@ -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;