Ensure that width and height fields are not null when we insert
authorBrion Vibber <brion@users.mediawiki.org>
Tue, 28 Jun 2005 22:07:09 +0000 (22:07 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Tue, 28 Jun 2005 22:07:09 +0000 (22:07 +0000)
includes/Image.php

index 69f24de..37f02d9 100644 (file)
@@ -1273,8 +1273,8 @@ class Image
                        array(
                                'img_name' => $this->name,
                                'img_size'=> $this->size,
-                               'img_width' => $this->width,
-                               'img_height' => $this->height,
+                               'img_width' => IntVal( $this->width ),
+                               'img_height' => IntVal( $this->height ),
                                'img_bits' => $this->bits,
                                'img_media_type' => $this->type,
                                'img_major_mime' => $major,
@@ -1319,8 +1319,8 @@ class Image
                        $dbw->update( 'image',
                                array( /* SET */
                                        'img_size' => $this->size,
-                                       'img_width' => $this->width,
-                                       'img_height' => $this->height,
+                                       'img_width' => intval( $this->width ),
+                                       'img_height' => intval( $this->height ),
                                        'img_bits' => $this->bits,
                                        'img_media_type' => $this->type,
                                        'img_major_mime' => $major,