Fix console statement violations

This commit is contained in:
gpt-engineer-app[bot]
2025-11-03 18:30:07 +00:00
parent e9b9faa3e1
commit 7eb0b77d76
10 changed files with 31 additions and 27 deletions

View File

@@ -6,6 +6,7 @@
*/
import DOMPurify from 'dompurify';
import { logger } from './logger';
/**
* Sanitize HTML content to prevent XSS attacks
@@ -39,14 +40,14 @@ export function sanitizeURL(url: string): string {
const allowedProtocols = ['http:', 'https:', 'mailto:'];
if (!allowedProtocols.includes(parsed.protocol)) {
console.warn(`Blocked potentially dangerous URL protocol: ${parsed.protocol}`);
logger.warn('Blocked potentially dangerous URL protocol', { protocol: parsed.protocol });
return '#';
}
return url;
} catch {
// Invalid URL format
console.warn(`Invalid URL format: ${url}`);
logger.warn('Invalid URL format', { url });
return '#';
}
}