• Модуль: socialnetwork
  • Путь к файлу: ~/bitrix/modules/socialnetwork/classes/general/functions.php
  • Класс: CSocNetTextParser
  • Вызов: CSocNetTextParser::convert_font_attr
function convert_font_attr($attr, $value = "", $text = "")
{
	if ($text == '') return "";
	if ($value == '') return $text;

	if ($attr == "size")
	{
		$count = count($this->arFontSize);
		if ($count <= 0)
			return $text;
		$value = intval($value >= $count ? ($count - 1) : $value);
		return "".$text."";
	}
	else if ($attr == 'color')
	{
		$value = preg_replace("/[^w#]/", "" , $value);
		return "".$text."";
	}
	else if ($attr == 'font')
	{
		$value = preg_replace("/[^w]/", "" , $value);
		return "".$text."";
	}
}