private array
$attributeSanitizers =
[];
/**
* @param array<string, false|array<string, bool>> $elementsConfig
*/
public function __construct(HtmlSanitizerConfig
$config, array
$elementsConfig) { $this->config =
$config;
$this->elementsConfig =
$elementsConfig;
$this->forcedAttributes =
$config->
getForcedAttributes();
foreach ($config->
getAttributeSanitizers() as $attributeSanitizer) { foreach ($attributeSanitizer->
getSupportedElements() ??
['*'
] as $element) { foreach ($attributeSanitizer->
getSupportedAttributes() ??
['*'
] as $attribute) { $this->attributeSanitizers
[$element][$attribute][] =
$attributeSanitizer;
} } } } public function visit(\DOMDocumentFragment
$domNode): ?NodeInterface
{