From 8d6cbde66cf9a0f3264562984a61cc16221a1896 Mon Sep 17 00:00:00 2001 From: Alfred Kamanda Date: Fri, 3 Oct 2025 17:25:34 +0300 Subject: [PATCH] sanitize invalid characters while showing the token details --- handlers/application/vouchers.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/handlers/application/vouchers.go b/handlers/application/vouchers.go index af2e9ef..056f989 100644 --- a/handlers/application/vouchers.go +++ b/handlers/application/vouchers.go @@ -289,8 +289,11 @@ func (h *MenuHandlers) GetVoucherDetails(ctx context.Context, sym string, input } res.FlagReset = append(res.FlagReset, flag_api_error) + // sanitize invalid characters + symbol := strings.ReplaceAll(voucherData.TokenSymbol, "USDâ‚®", "USDT") + res.Content = fmt.Sprintf( - "Name: %s\nSymbol: %s\nProduct: %s\nLocation: %s", voucherData.TokenName, voucherData.TokenSymbol, voucherData.TokenCommodity, voucherData.TokenLocation, + "Name: %s\nSymbol: %s\nProduct: %s\nLocation: %s", voucherData.TokenName, symbol, voucherData.TokenCommodity, voucherData.TokenLocation, ) return res, nil