refactor: update PHP to 8.2
fix: possible division by 0 on statistics page fix: duplicated messages on discord notifications docs: update readme
This commit is contained in:
@@ -187,7 +187,12 @@ if ($result) {
|
||||
$totalCostPerYear = $totalCostPerMonth * 12;
|
||||
|
||||
// Calculate average subscription monthly cost
|
||||
$averageSubscriptionCost = $totalCostPerMonth / $activeSubscriptions;
|
||||
if ($activeSubscriptions > 0) {
|
||||
$averageSubscriptionCost = $totalCostPerMonth / $activeSubscriptions;
|
||||
} else {
|
||||
$totalCostPerYear = 0;
|
||||
$averageSubscriptionCost = 0;
|
||||
}
|
||||
} else {
|
||||
$totalCostPerYear = 0;
|
||||
$averageSubscriptionCost = 0;
|
||||
|
||||
Reference in New Issue
Block a user