Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

BUG Fixed divide by zero with SetRatioSize on missing image file

Fixes issue #2047
  • Loading branch information...
commit b3ca4a275bc10e82e85167a842d94d694c94ae0b 1 parent 58a2eb0
@tractorcow tractorcow authored
Showing with 3 additions and 0 deletions.
  1. +3 −0  model/Image.php
View
3  model/Image.php
@@ -206,6 +206,9 @@ public function loadUploadedImage($tmpFile) {
*/
public function SetRatioSize($width, $height) {
+ // Prevent divide by zero on missing/blank file
+ if(empty($this->width) || empty($this->height)) return null;
+
// Check if image is already sized to the correct dimension
$widthRatio = $width / $this->width;
$heightRatio = $height / $this->height;
Please sign in to comment.
Something went wrong with that request. Please try again.