• Модуль: fileman
  • Путь к файлу: ~/bitrix/modules/fileman/lib/block/sanitizer.php
  • Класс: BitrixFilemanBlockSanitizer
  • Вызов: Sanitizer::replacePhpToTags
static function replacePhpToTags(&$html)
{
	if(!preg_match_all('/()/i', $html, $matches, PREG_SET_ORDER))
	{
		return [];
	}

	if (!is_array($matches))
	{
		return [];
	}

	$stored = [];
	$counter = 0;
	foreach($matches as $key => $value)
	{
		$counter++;
		$stored[""] = $value[0];
	}

	$html = str_replace(
		array_values($stored),
		array_keys($stored),
		$html
	);

	return $stored;
}