• Модуль: search
  • Путь к файлу: ~/bitrix/modules/search/classes/general/statistic.php
  • Класс: CSearchStatistic
  • Вызов: CSearchStatistic::__construct
function __construct($phrase = "", $tags = "")
{
	$phrase = ToLower(trim($phrase, " tnr"));
	if ($l = mb_strlen($phrase))
	{
		if ($l > 250)
		{
			$p = mb_strrpos($phrase, ' ');
			if ($p === false)
				$this->_phrase = mb_substr($phrase, 0, 250);
			else
				$this->_phrase = mb_substr($phrase, 0, $p);
		}
		else
		{
			$this->_phrase = $phrase;
		}
	}
	else
	{
		$this->_phrase = false;
	}

	$arTags = tags_prepare($tags);
	if (count($arTags))
	{
		asort($arTags);
		$this->_tags = implode(", ", $arTags);
	}
	else
	{
		$this->_tags = false;
	}

	$this->_session_id = bitrix_sessid();

	if (isset($_SESSION["SESS_SESSION_ID"]))
		$this->_stat_sess_id = intval($_SESSION["SESS_SESSION_ID"]);
}