From f1a7f301679d672b4676b4b573183f3c7e5a2ac1 Mon Sep 17 00:00:00 2001 From: James Cole Date: Mon, 21 Aug 2017 08:47:03 +0200 Subject: [PATCH] Fix division by zero. [skip ci] --- app/Repositories/Tag/TagRepository.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Repositories/Tag/TagRepository.php b/app/Repositories/Tag/TagRepository.php index ee0e6fe374..3c9b9728c3 100644 --- a/app/Repositories/Tag/TagRepository.php +++ b/app/Repositories/Tag/TagRepository.php @@ -340,12 +340,12 @@ class TagRepository implements TagRepositoryInterface $amountDiff = $max - $min; $diff = $range[1] - $range[0]; $step = 1; - if ($diff !== 0) { + if ($diff != 0) { $step = $amountDiff / $diff; } - $extra = round($amount / $step); + return intval($range[0] + $extra); } }