Escaper
class Escaper
Context-aware escaping.
Constants
| Text |
|
| JavaScript |
|
| Css |
|
| ICal |
|
| HtmlText |
|
| HtmlComment |
|
| HtmlBogusTag |
|
| HtmlRawText |
|
| HtmlTag |
|
| HtmlAttribute |
|
| private Convertors |
|
Methods
No description
No description
No description
Returns the current escaping state as a string (e.g. "html/attr/js").
No description
No description
No description
No description
No description
No description
No description
Applies mandatory escaping that cannot be suppressed (e.g. quotes in attributes).
Generates code that converts content between content types at runtime using FilterInfo.
Returns a callable that converts content from $source type to $dest type, or null if unsupported.
Details
at line 78
__construct(string $contentType)
No description
at line 87
string
getContentType()
No description
at line 93
string
getState()
No description
at line 102
string
export()
Returns the current escaping state as a string (e.g. "html/attr/js").
at line 108
void
enterContentType(string $type)
No description
at line 114
void
enterHtmlText(ElementNode $el)
No description
at line 134
void
enterHtmlTag(string $name)
No description
at line 140
void
enterHtmlRaw(string $subType)
No description
at line 147
void
enterHtmlAttribute(string|null $name = null)
No description
at line 163
void
enterHtmlBogusTag()
No description
at line 169
void
enterHtmlComment()
No description
at line 175
string
escape(string $str)
No description
at line 216
string
escapeMandatory(string $str, Position|null $position = null)
Applies mandatory escaping that cannot be suppressed (e.g. quotes in attributes).
at line 241
string
escapeContent(string $str)
Generates code that converts content between content types at runtime using FilterInfo.
at line 253
static callable|null
getConvertor(string $source, string $dest)
Returns a callable that converts content from $source type to $dest type, or null if unsupported.