From f241ba23018ee910ab859b2ce860b4c0678d6402 Mon Sep 17 00:00:00 2001 From: Miguel Ribeiro Date: Mon, 29 Jul 2024 13:57:20 +0200 Subject: [PATCH] fix: allow usernames with capital letters fix: use 2 decimal places for price on the calendar fix: use 2 decimal places for price when exporting ical in the calendar --- endpoints/admin/adduser.php | 2 +- endpoints/subscription/exportcalendar.php | 1 + endpoints/subscription/getcalendar.php | 1 + includes/version.php | 2 +- 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/endpoints/admin/adduser.php b/endpoints/admin/adduser.php index c17ea8e12..44bf243bf 100644 --- a/endpoints/admin/adduser.php +++ b/endpoints/admin/adduser.php @@ -122,7 +122,7 @@ function validate($value) $loggedInUserId = $userId; $email = validate($data['email']); - $username = validate(strtolower($data['username'])); + $username = validate($data['username']); $password = $data['password']; if (empty($username) || empty($password) || empty($email)) { diff --git a/endpoints/subscription/exportcalendar.php b/endpoints/subscription/exportcalendar.php index be16b9112..6a8fe29d6 100644 --- a/endpoints/subscription/exportcalendar.php +++ b/endpoints/subscription/exportcalendar.php @@ -35,6 +35,7 @@ $subscription['payment_method'] = $payment_methods[$subscription['payment_method_id']]['name']; $subscription['currency'] = $currencies[$subscription['currency_id']]['symbol']; $subscription['trigger'] = $subscription['notify_days_before'] ? $subscription['notify_days_before'] : 1; + $subscription['price'] = number_format($subscription['price'], 2); // Create ICS from subscription information $uid = uniqid(); diff --git a/endpoints/subscription/getcalendar.php b/endpoints/subscription/getcalendar.php index 298be0abc..17e18acff 100644 --- a/endpoints/subscription/getcalendar.php +++ b/endpoints/subscription/getcalendar.php @@ -35,6 +35,7 @@ $subscription['category'] = $categories[$subscription['category_id']]['name']; $subscription['payment_method'] = $payment_methods[$subscription['payment_method_id']]['name']; $subscription['currency'] = $currencies[$subscription['currency_id']]['symbol']; + $subscription['price'] = number_format($subscription['price'], 2); echo json_encode([ 'success' => true, diff --git a/includes/version.php b/includes/version.php index 63787b525..d7baef171 100644 --- a/includes/version.php +++ b/includes/version.php @@ -1,3 +1,3 @@ \ No newline at end of file