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:
Miguel Ribeiro
2024-05-17 17:03:46 +02:00
committed by GitHub
parent b519376a27
commit d44b40b0ce
5 changed files with 11 additions and 13 deletions
+6 -1
View File
@@ -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;