Procházet zdrojové kódy

Add a warning for StripTags

jvoisin před 2 roky
rodič
revize
b94756bbf0
1 změnil soubory, kde provedl 1 přidání a 0 odebrání
  1. 1 0
      internal/reader/sanitizer/strip_tags.go

+ 1 - 0
internal/reader/sanitizer/strip_tags.go

@@ -11,6 +11,7 @@ import (
 )
 )
 
 
 // StripTags removes all HTML/XML tags from the input string.
 // StripTags removes all HTML/XML tags from the input string.
+// This function must *only* be used for cosmetic purposes, not to prevent code injections like XSS.
 func StripTags(input string) string {
 func StripTags(input string) string {
 	tokenizer := html.NewTokenizer(bytes.NewBufferString(input))
 	tokenizer := html.NewTokenizer(bytes.NewBufferString(input))
 	var buffer bytes.Buffer
 	var buffer bytes.Buffer