• Модуль: tasks
  • Путь к файлу: ~/bitrix/modules/tasks/lib/ui.php
  • Класс: BitrixTasksUI
  • Вызов: UI::convertHtmlToSafeHtml
static function convertHtmlToSafeHtml($value)
{
	$value = (string) $value;
	if($value == '')
	{
		return '';
	}

	static $sanitizer;

	if($sanitizer === null)
	{
		$sanitizer = new CBXSanitizer();
		$sanitizer->setLevel(CBXSanitizer::SECURE_LEVEL_LOW);
		$sanitizer->addTags(
			array(
				'blockquote' => array('style', 'class', 'id'),
				'colgroup'   => array('style', 'class', 'id'),
				'col'        => array('style', 'class', 'id', 'width', 'height', 'span', 'style')
			)
		);
		$sanitizer->applyHtmlSpecChars(true);

		// if we don't disable this, than text such as "df 1 < 2 dasfa and 5 > 4 will be partially lost"
		$sanitizer->deleteSanitizedTags(false);
	}

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