enhanced security and input validation

This commit is contained in:
2025-06-09 13:27:44 +02:00
parent e1c6a35325
commit 597659a148
3 changed files with 106 additions and 4 deletions

View File

@@ -1,8 +1,7 @@
import { sanitizeHtml, validateDomain } from './security'
export function sanitizeUrl(url: string): string {
return url
.trim()
.replace(/[<>'"]/g, '') // Remove potential XSS characters
.substring(0, 2048) // Limit length
return sanitizeHtml(url.trim().substring(0, 2048))
}
export function validateEmail(email: string): boolean {