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 53
string
escapeHTML(string|null $string, string $charset, bool $doubleEncode = true)
Returns a string that has been escaped for a HTML body context.
at line 64
string
escapeURL(string|null $string)
Returns a string that has been escaped for a URI or parameter context.
at line 77
protected string
attributeEscaper(array $matches)
Escapes characters for use in a HTML attribute context.
(This method contains code from the SecurityMultiTool library).
at line 126
string
escapeAttribute(string|null $string, string $charset)
Returns a string that has been escaped for a HTML attribute context.
at line 151
protected string
cssEscaper(array $matches)
Escapes characters for use in a CSS context.
(This method contains code from the SecurityMultiTool library).
at line 176
string
escapeCSS(string|null $string, string $charset)
Returns a string that has been escaped for a CSS context.
at line 206
protected string
javascriptEscaper(array $matches)
Escapes characters for use in a Javascript context.
(This method contains code from the SecurityMultiTool library).
at line 227
string
escapeJavascript(string|null $string, string $charset)
Returns a string that has been escaped for a Javascript context.