SafeString extension

Extension on String to provide additional security and sanitization methods.

on

Methods

escape([HtmlEscapeMode mode = HtmlEscapeMode.unknown]) → String

Available on String, provided by the SafeString extension

Escapes HTML special characters in the string to their corresponding HTML entities.
fromSafe(String password) → String

Available on String, provided by the SafeString extension

Decrypts a base64-encoded AES-encrypted string using a provided password.
removeHtmlTags({String replace = ''}) → String

Available on String, provided by the SafeString extension

Removes HTML tags from the string, optionally replacing them with a specified string.
removeScripts() → String

Available on String, provided by the SafeString extension

Removes <script> tags and JavaScript event handlers from the string.
toSafe(String password) → String

Available on String, provided by the SafeString extension

Encrypts the string using AES encryption with a provided password.
unescape() → String

Available on String, provided by the SafeString extension

Unescapes HTML entities in the string back to their corresponding characters.