From 3e32a5e121c244bd4e7011c4219f1ea6392bf082 Mon Sep 17 00:00:00 2001 From: jekkos Date: Fri, 20 Sep 2024 00:00:14 +0200 Subject: [PATCH] Giftcard number validation (#2935) --- app/Controllers/Giftcards.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Controllers/Giftcards.php b/app/Controllers/Giftcards.php index e685177fe..5eef50a6c 100644 --- a/app/Controllers/Giftcards.php +++ b/app/Controllers/Giftcards.php @@ -174,7 +174,7 @@ class Giftcards extends Secure_Controller { $giftcard_amount = prepare_decimal($this->request->getPost('giftcard_amount')); $parsed_value = filter_var($giftcard_amount, FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); - echo json_encode (['success' => $parsed_value !== false, 'giftcard_amount' => to_currency_no_money($parsed_value)]); + echo json_encode (['success' => $parsed_value !== false && $parsed_value > 0, 'giftcard_amount' => to_currency_no_money($parsed_value)]); } /**