fix(admin): let editPlus subtract Plus/bonus days as the form advertises (#254)

This commit is contained in:
Ferywir
2026-06-22 17:41:28 +02:00
committed by GitHub
parent 6e79c47951
commit 6888a09b5f
2 changed files with 4 additions and 2 deletions
+3 -1
View File
@@ -64,7 +64,9 @@ if (!$user) {
foreach ($bonusDuration as $key => $add) {
$current = (int)($user[$key] ?? 0);
$base = $current < $time ? $time : $current;
$bonusDuration[$key] = $add > 0 ? $base + $add : $current;
// A negative value subtracts days (the form advertises "Add / Remove Days").
// 0 leaves the current expiry untouched; the clamp below caps it at "expired".
$bonusDuration[$key] = $add != 0 ? $base + $add : $current;
if ($bonusDuration[$key] < $time) {
$bonusDuration[$key] = 0;
}