This commit is contained in:
Tomas Dvorak
2025-11-21 08:44:44 +01:00
parent c941313fd5
commit f5b6f83974
108 changed files with 8642 additions and 5871 deletions
+4 -3
View File
@@ -126,15 +126,15 @@ func SanitizeCommentContent(content string) string {
// Remove script tags and their content
re := regexp.MustCompile(`(?i)<script[^>]*>.*?</script>`)
content = re.ReplaceAllString(content, "")
// Remove iframe tags
re = regexp.MustCompile(`(?i)<iframe[^>]*>.*?</iframe>`)
content = re.ReplaceAllString(content, "")
// Remove on* event handlers
re = regexp.MustCompile(`(?i)\s*on\w+\s*=\s*["'][^"']*["']`)
content = re.ReplaceAllString(content, "")
return strings.TrimSpace(content)
}
@@ -154,6 +154,7 @@ func ValidateReactionType(reactionType string) error {
"heart": true,
"smile": true,
"laugh": true,
"surprised": true,
"thumbs_up": true,
"thumbs_down": true,
"sad": true,