Skip to content

Commit

Permalink
Avoid potential divide by 0
Browse files Browse the repository at this point in the history
  • Loading branch information
cheesegrits committed Oct 31, 2018
1 parent 70b7efe commit 5b39d23
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion components/com_fabrik/layouts/fabrik-bootstrap-grid.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@

$d = $displayData;

$span = floor(12 / $d->columns);
// a void potential divide by 0 if something went wrong and $d->columns is 0 or empty
$span = empty($d->columns) ? 12 : floor(12 / $d->columns);
$i = 0;
$id = is_null($d->spanId) ? '' : ' id="' . $d->spanId . '"';
$grid = array();
Expand Down

0 comments on commit 5b39d23

Please sign in to comment.