• Модуль: main
  • Путь к файлу: ~/bitrix/modules/main/lib/userconsent/agreement.php
  • Класс: BitrixMainUserConsentAgreement
  • Вызов: Agreement::getHtml
public function getHtml()
{
	$text = $this->getContent();

	$text = ($this->isAgreementTextHtml ? $text : nl2br($text));
	$sanitizer = new CBXSanitizer;
	$sanitizer->setLevel(CBXSanitizer::SECURE_LEVEL_MIDDLE);
	$sanitizer->allowAttributes([
		'target' => [
			'tag' => function ($tag)
			{
				return $tag === 'a';
			},
			'content' => function ($tag)
			{
				return true;
			},
		]
	]);

	return $sanitizer->sanitizeHtml($text);
}