mirror of
https://github.com/Dvorinka/MyClubServer.git
synced 2026-06-04 02:32:57 +00:00
dev day #99
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user