Sanitize Class
The Sanitize class provides HTML and XSS sanitization.
s = new Sanitizes.html(cInput)
Sanitize HTML by stripping dangerous tags, keeping safe ones.
safe = s.html('<script>alert("xss")</script><p>Safe</p>')
# Returns: "<p>Safe</p>"s.strict(cInput)
Strictly sanitize HTML by stripping all tags.
text = s.strict('<b>Bold</b> <script>evil()</script>')
# Returns: "Bold evil()"s.escapeHtml(cInput)
Escape HTML special characters to entities.
escaped = s.escapeHtml('<div class="test">Hello & goodbye</div>')
# Returns: "<div class="test">Hello & goodbye</div>"