- Модуль: main
- Путь к файлу: ~/bitrix/modules/main/classes/general/sanitizer.php
- Класс: CBXSanitizer
- Вызов: CBXSanitizer::processAttributes
protected function processAttributes(string $attrData, string $currTag): array
{
$attr = [];
$arTagAttrs = $this->extractAttributes($attrData);
foreach($arTagAttrs as $arTagAttr)
{
// Attribute name
$arTagAttr[1] = mb_strtolower($arTagAttr[1]);
$attrAllowed = in_array($arTagAttr[1], $this->arHtmlTags[$currTag], true);
if (!$attrAllowed && array_key_exists($arTagAttr[1], $this->additionalAttrs))
{
$attrAllowed = true === call_user_func($this->additionalAttrs[$arTagAttr[1]]['tag'], $currTag);
}
if ($attrAllowed)
{
// Attribute value. Wrap attribute by "
$arTagAttr[3] = str_replace('"', "'", $arTagAttr[3]);
if($this->IsValidAttr($arTagAttr))
{
$attr[$arTagAttr[1]] = $this->encodeAttributeValue($arTagAttr);
}
}
}
return $attr;
}