EscaperTrait
trait EscaperTrait
Escaper trait.
Properties
protected array | $htmlNamedEntityMap | HTML entity map. |
Methods
Returns a string that has been escaped for a HTML body context.
Returns a string that has been escaped for a URI or parameter context.
Escapes characters for use in a HTML attribute context.
Returns a string that has been escaped for a HTML attribute context.
Escapes characters for use in a CSS context.
Returns a string that has been escaped for a CSS context.
Escapes characters for use in a Javascript context.
Returns a string that has been escaped for a Javascript context.
Details
at line 50
string
escapeHTML(string|null $string, string $charset, bool $doubleEncode = true)
Returns a string that has been escaped for a HTML body context.
at line 61
string
escapeURL(string|null $string)
Returns a string that has been escaped for a URI or parameter context.
at line 74
protected string
attributeEscaper(array $matches)
Escapes characters for use in a HTML attribute context.
(This method contains code from the SecurityMultiTool library).
at line 123
string
escapeAttribute(string|null $string, string $charset)
Returns a string that has been escaped for a HTML attribute context.
at line 148
protected string
cssEscaper(array $matches)
Escapes characters for use in a CSS context.
(This method contains code from the SecurityMultiTool library).
at line 173
string
escapeCSS(string|null $string, string $charset)
Returns a string that has been escaped for a CSS context.
at line 203
protected string
javascriptEscaper(array $matches)
Escapes characters for use in a Javascript context.
(This method contains code from the SecurityMultiTool library).
at line 224
string
escapeJavascript(string|null $string, string $charset)
Returns a string that has been escaped for a Javascript context.