Correctly escape strings if needed and check for it

This commit is contained in:
2024-10-16 16:51:39 +02:00
parent c200d5bf73
commit f27116930a
4 changed files with 26 additions and 1 deletions

12
atom.go
View File

@@ -28,6 +28,18 @@ func isValidURI(uri URI) bool {
return isValidURL(uri) || isValidURN(uri)
}
func isCorrectlyEscaped(text string) bool {
relevantEntities := []string{"&", "<", ">", """, "'"}
for _, entity := range relevantEntities {
if strings.Contains(text, entity) {
return false
}
}
return true
}
func isCompositeMediaType(mediaType string) bool {
mediaType, _, err := mime.ParseMediaType(mediaType)
if err != nil {