public static function XBBCodeFilter::filterXss in Extensible BBCode 8.3
Same name and namespace in other branches
- 4.0.x src/Plugin/Filter/XBBCodeFilter.php \Drupal\xbbcode\Plugin\Filter\XBBCodeFilter::filterXss()
Escape unsafe markup in text elements and the source of tag elements.
This is a safety feature that allows the BBCode processor to be used on its own (without HTML restrictors) while still maintaining markup safety.
Parameters
\Drupal\xbbcode\Parser\Tree\NodeElementInterface $tree: The parse tree.
2 calls to XBBCodeFilter::filterXss()
- TagFormBase::form in src/
Form/ TagFormBase.php - Gets the actual form array to be built.
- XBBCodeFilter::process in src/
Plugin/ Filter/ XBBCodeFilter.php - Performs the filter processing.
File
- src/
Plugin/ Filter/ XBBCodeFilter.php, line 320
Class
- XBBCodeFilter
- Provides a filter that converts BBCode to HTML.
Namespace
Drupal\xbbcode\Plugin\FilterCode
public static function filterXss(NodeElementInterface $tree) : void {
foreach ($tree
->getDescendants() as $node) {
if ($node instanceof TextElement) {
$node
->setText(XssEscape::filterAdmin($node
->getText()));
}
if ($node instanceof TagElementInterface) {
$node
->setSource(XssEscape::filterAdmin($node
->getSource()));
}
}
}