• Модуль: mail
  • Путь к файлу: ~/bitrix/modules/mail/lib/message.php
  • Класс: BitrixMailMessage
  • Вызов: Message::removeReplyHead
protected function removeReplyHead(&$text)
{
	list($before, $after) = explode(static::QUOTE_PLACEHOLDER, $text, 2);

	if (!trim($before))
		return $text;

	$data = static::reduceTags($before);

	/**
	 * Outlook
	 *
	 * ________________________________________
	 * From: 
	 * Sent: 
	 * To: 
	 * Subject: 
	 */
	$fullHeadRegex = '/(?:^|nn)
		(?
_{20,}n(?:[tx20]*n)?)? (?(?:[^:n]{1,20}:[tx20]+.+(?:n|$)){2,6})s*$ /x'.BX_UTF_PCRE_MODIFIER; if (preg_match($fullHeadRegex, $data, $matches)) { $score = (int) !empty($matches['hr']); $score += $this->scoreFullHead($matches['head']); if ($score > 1) { $pattern = preg_replace(array('/.+/', '/n/'), array('.+', 'n'), $matches[0]); $before = preg_replace_callback( sprintf('/%s$/', $pattern), function($matches) { return Message::reduceHead($matches[0]); }, $before ); return sprintf('%s%s%s', $before, static::QUOTE_PLACEHOLDER, $after); } } /** * Gmail, Yandex, Thunderbird * * ,