mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 16:40:24 +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