utils

package
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 20, 2025 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FilterUnicode

func FilterUnicode(input string) string

FilterUnicode removes or replaces Unicode characters that are not compatible with utf8mb3 This ensures OTRS compatibility when Unicode support is disabled

func IsHTML

func IsHTML(content string) bool

IsHTML checks if the content appears to be HTML

func StripHTML

func StripHTML(html string) string

StripHTML removes all HTML tags and returns plain text

Types

type HTMLSanitizer

type HTMLSanitizer struct {
	// contains filtered or unexported fields
}

HTMLSanitizer provides HTML sanitization for user input

func NewHTMLSanitizer

func NewHTMLSanitizer() *HTMLSanitizer

NewHTMLSanitizer creates a new HTML sanitizer with GOTRS-specific policy

func (*HTMLSanitizer) Sanitize

func (s *HTMLSanitizer) Sanitize(html string) string

Sanitize cleans HTML content to prevent XSS attacks

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL