Skip to content

Commit

Permalink
Merge pull request #623 from Hrumpa/patch-1
Browse files Browse the repository at this point in the history
Possible division by zero at Weight::convert()
  • Loading branch information
danielkerr committed Apr 16, 2013
2 parents e5b72a7 + 5795d70 commit 521b748
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions upload/system/library/weight.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ public function convert($value, $from, $to) {
if (isset($this->weights[$from])) {
$from = $this->weights[$from]['value'];
} else {
$from = 0;
$from = 1;
}

if (isset($this->weights[$to])) {
$to = $this->weights[$to]['value'];
} else {
$to = 0;
$to = 1;
}

return $value * ($to / $from);
Expand All @@ -54,4 +54,4 @@ public function getUnit($weight_class_id) {
}
}
}
?>
?>

0 comments on commit 521b748

Please sign in to comment.