Skip to content

Firefly III: a personal finances manager

Sanity check on number.

James Cole935634e487ec
diff --git a/app/Http/Controllers/Budget/BudgetLimitController.php b/app/Http/Controllers/Budget/BudgetLimitController.php
index 7eade3fe56..a293e25fae 100644
--- a/app/Http/Controllers/Budget/BudgetLimitController.php
+++ b/app/Http/Controllers/Budget/BudgetLimitController.php
@@ -202,7 +202,9 @@ class BudgetLimitController extends Controller
if ('' === $amount) {
$amount = '0';
}
-
+ if ((int)$amount > 268435456) { // 268 million, intentional integer
+ $amount = '268435456';
+ }
// sanity check on amount:
if (0 === bccomp($amount, '0')) {
$budgetId = $budgetLimit->budget_id;
@@ -217,9 +219,7 @@ class BudgetLimitController extends Controller
return response()->json($array);
}
- if ((int)$amount > 268435456) { // 268 million, intentional integer
- $amount = '268435456';
- }
+
if (-1 === bccomp($amount, '0')) {
$amount = bcmul($amount, '-1');
}