From 6da03b43f626c09c80b185f7fd4ba2a0578381c9 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 16 Nov 2025 16:58:20 +0000 Subject: [PATCH] =?UTF-8?q?fix:=20melhorar=20valida=C3=A7=C3=A3o=20de=20UR?= =?UTF-8?q?L=20do=20logo=20do=20cart=C3=A3o?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Verificar se logo começa com /, http:// ou https:// - Prevenir erro com logos que são apenas nomes de arquivo - Exibir fallback quando logo não é uma URL válida --- .../installment-analysis/installment-group-card.tsx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/components/dashboard/installment-analysis/installment-group-card.tsx b/components/dashboard/installment-analysis/installment-group-card.tsx index 7831ba6..9e0e250 100644 --- a/components/dashboard/installment-analysis/installment-group-card.tsx +++ b/components/dashboard/installment-analysis/installment-group-card.tsx @@ -34,8 +34,13 @@ export function InstallmentGroupCard({ const unpaidCount = unpaidInstallments.length; - // Validar se o logo é uma URL válida - const isValidLogo = group.cartaoLogo && group.cartaoLogo.trim().length > 0; + // Validar se o logo é uma URL válida (deve começar com / ou http:// ou https://) + const isValidLogo = + group.cartaoLogo && + group.cartaoLogo.trim().length > 0 && + (group.cartaoLogo.startsWith('/') || + group.cartaoLogo.startsWith('http://') || + group.cartaoLogo.startsWith('https://')); const isFullySelected = selectedInstallments.size === unpaidInstallments.length &&