Giftcard number validation (#2935)

This commit is contained in:
jekkos
2024-09-20 00:00:14 +02:00
parent 4b8d009c76
commit 3e32a5e121

View File

@@ -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)]);
}
/**