• Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/vcard/vcardreader.php
  • Класс: Bitrix\Crm\VCard\VCardReader
  • Вызов: VCardReader::readElementContent
public function readElementContent()
{
	if($this->elementContent !== null)
	{
		$this->elementContent = null;
	}

	if(!$this->readToBufferIfEmpty())
	{
		return false;
	}

	do
	{
		$pos = mb_stripos($this->buffer, 'BEGIN:VCARD', 0);
	}
	while($pos === false && $this->readToBuffer());

	if($pos === false)
	{
		return false;
	}

	$beginPos = $pos;

	do
	{
		$pos = mb_stripos($this->buffer, 'END:VCARD', $beginPos + 11); // 11 is strlen('BEGIN:VCARD')
	}
	while($pos === false && $this->readToBuffer());

	if($pos === false)
	{
		return false;
	}

	$endPos = $pos;

	$borderPos = $endPos + 9; // 9 is strlen('END:VCARD')
	$this->elementContent = mb_substr($this->buffer, $beginPos, $borderPos - $beginPos);
	$this->buffer = mb_substr($this->buffer, $borderPos);
	$this->elementBorderPosition = $this->filePosition - Main\Text\BinaryString::getLength($this->buffer);

	return $this->elementContent !== '';
}