Documentation
¶
Index ¶
Constants ¶
const (
NoEscapeHtmlEnvVar = "NO_ESCAPE_HTML"
)
Variables ¶
This section is empty.
Functions ¶
func EscapeHtmlInObject ¶
func EscapeHtmlInObject(obj interface{}) interface{}
EscapeHtmlInObject escapes HTML tags in all string fields and properties of an object using reflection Also processes slice/array fields: if slice of objects - processes each object, if slice of strings - escapes each string Can be disabled by setting NO_ESCAPE_HTML environment variable to "true"
func EscapeHtmlInObjectSlice ¶
func EscapeHtmlInObjectSlice(slice interface{}) interface{}
EscapeHtmlInObjectSlice escapes HTML tags in all string fields of objects in a slice using reflection Can be disabled by setting NO_ESCAPE_HTML environment variable to "true"
func EscapeHtmlTags ¶
EscapeHtmlTags escapes HTML tags to prevent XSS attacks. First checks if the string contains HTML tags using regex pattern. Only performs escaping if HTML tags are detected. Escapes all < as \< and > as \> avoiding double escaping. Can be disabled by setting NO_ESCAPE_HTML environment variable to "true"
Types ¶
This section is empty.