Correctly escape strings if needed and check for it
This commit is contained in:
12
atom.go
12
atom.go
@@ -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 {
|
||||
|
Reference in New Issue
Block a user