fix(ui): fix xss in thinking

This commit is contained in:
wizardchen
2025-09-16 12:31:17 +08:00
committed by lyingbug
parent 5e22f96d37
commit 4005aa3ded
3 changed files with 17 additions and 3 deletions
+2 -1
View File
@@ -15,6 +15,7 @@ var (
regexp.MustCompile(`(?i)<iframe[^>]*>.*?</iframe>`),
regexp.MustCompile(`(?i)<object[^>]*>.*?</object>`),
regexp.MustCompile(`(?i)<embed[^>]*>.*?</embed>`),
regexp.MustCompile(`(?i)<embed[^>]*>`),
regexp.MustCompile(`(?i)<form[^>]*>.*?</form>`),
regexp.MustCompile(`(?i)<input[^>]*>`),
regexp.MustCompile(`(?i)<button[^>]*>.*?</button>`),
@@ -151,7 +152,7 @@ func CleanMarkdown(input string) string {
cleaned = pattern.ReplaceAllString(cleaned, "")
}
return strings.TrimSpace(cleaned)
return cleaned
}
// SanitizeForDisplay 为显示清理内容