mirror of
https://gitcode.com/gitea/gitea.git
synced 2025-06-02 01:59:36 +08:00
Fix data URI scramble (#16098)
* Removed unused method. * No prefix for data uris. * Added test to prevent regressions.
This commit is contained in:
@ -131,13 +131,3 @@ func SanitizeReader(r io.Reader) *bytes.Buffer {
|
||||
NewSanitizer()
|
||||
return sanitizer.policy.SanitizeReader(r)
|
||||
}
|
||||
|
||||
// SanitizeBytes takes a []byte slice that contains a HTML fragment or document and applies policy whitelist.
|
||||
func SanitizeBytes(b []byte) []byte {
|
||||
if len(b) == 0 {
|
||||
// nothing to sanitize
|
||||
return b
|
||||
}
|
||||
NewSanitizer()
|
||||
return sanitizer.policy.SanitizeBytes(b)
|
||||
}
|
||||
|
Reference in New Issue
Block a user