• Модуль: socialnetwork
  • Путь к файлу: ~/bitrix/modules/socialnetwork/classes/general/functions.php
  • Класс: CSocNetTextParser
  • Вызов: CSocNetTextParser::part_long_words
function part_long_words($str)
{
	$word_separator = $this->word_separator;
	if (($this->MaxStringLen > 0) && (trim($str) <> ''))
	{
		$str = str_replace(
			array(chr(1), chr(2), chr(3), chr(4), chr(5), chr(6), "&", "<", ">", """, " ", "©", "®", "™"),
			array("", "", "", "", "", "", chr(5), "<", ">", chr(6), chr(1), chr(2), chr(3), chr(4)),
			$str
		);
		$this->matchNum = 2;
		$str = preg_replace_callback(
			"/(?<=[".$word_separator."]|^)(([^".$word_separator."]+))(?=[".$word_separator."]|$)/is".BX_UTF_PCRE_MODIFIER, 
			array($this, "cut_long_words_callback"),
			$str
		);
		$str = str_replace(
			array(chr(5), "<", ">", chr(6), chr(1), chr(2), chr(3), chr(4), "<WBR/>", "<WBR>", "&shy;"),
			array("&", "<", ">", """, " ", "©", "®", "™", "", "", "­"),
			$str
		);
	}
	return $str;
}