• Модуль: imopenlines
  • Путь к файлу: ~/bitrix/modules/imopenlines/lib/tracker.php
  • Класс: BitrixImOpenLinesTracker
  • Вызов: Tracker::prepareMessage
static function prepareMessage($text): string
{
	$textParser = new CTextParser();
	$textParser->allow = array("HTML" => "N", "USER" => "N",  "ANCHOR" => "Y", "BIU" => "Y", "IMG" => "Y", "QUOTE" => "N", "CODE" => "N", "FONT" => "N", "LIST" => "N", "SMILES" => "N", "NL2BR" => "Y", "VIDEO" => "N", "TABLE" => "N", "CUT_ANCHOR" => "N", "ALIGN" => "N");

	$text = preg_replace("/[[buis]](.*?)[/[buis]]/i", "$1", $text);
	$text = $textParser->convertText($text);

	$text = preg_replace('/<([w]+)[^>]*>(.*?)/i', "", $text);
	$text = preg_replace("/[USER=([0-9]{1,})](.*?)[/USER]/i", "$2", $text);
	$text = preg_replace("/[CHAT=([0-9]{1,})](.*?)[/CHAT]/i", "$2", $text);
	$text = preg_replace("/[SEND(?:=(.+?))?](.+?)?[/SEND]/i", " ", $text);
	$text = preg_replace("/[PUT(?:=(.+?))?](.+?)?[/PUT]/i", " ", $text);
	$text = preg_replace("/[CALL(?:=(.+?))?](.+?)?[/CALL]/i", " ", $text);
	$text = preg_replace("/[PCH=([0-9]{1,})](.*?)[/PCH]/i", " ", $text);
	$text = preg_replace("/[ATTACH=([0-9]{1,})]/i", " ", $text);
	$text = preg_replace("/[ICON=([^]]*)]/i", " ", $text);
	$text = preg_replace('#-{54}.+?-{54}#s', " ", str_replace(array("#BR#"), Array(" "), $text));

	return $text;
}