• Модуль: subscribe
  • Путь к файлу: ~/bitrix/modules/subscribe/classes/general/template.php
  • Класс: CPostingTemplate
  • Вызов: CPostingTemplate::IsExists
static function IsExists($path="")
{
	$io = CBXVirtualIo::GetInstance();

	$dir = mb_substr(getLocalPath("php_interface/subscribe/templates", BX_PERSONAL_ROOT), 1);
	if (mb_strpos($path, $dir."/") === 0)
	{
		$template = mb_substr($path, mb_strlen($dir) + 1);
		if(
			mb_strpos($template, "") !== false
			|| mb_strpos($template, "\") !== false
			|| mb_strpos($template, "/") !== false
			|| mb_strpos($template, "..") !== false
		)
		{
			return false;
		}

		return $io->DirectoryExists($_SERVER["DOCUMENT_ROOT"]."/".$path);
	}
	return false;
}