• Модуль: security
  • Путь к файлу: ~/bitrix/modules/security/classes/general/tests/environment.php
  • Класс: CSecurityEnvironmentTest
  • Вызов: CSecurityEnvironmentTest::checkBitrixTempPath
protected function checkBitrixTempPath()
{
	$io = CBXVirtualIo::GetInstance();

	$path = CTempFile::GetAbsoluteRoot();
	$path = $io->CombinePath($path);

	$documentRoot = self::getParam("DOCUMENT_ROOT", $_SERVER["DOCUMENT_ROOT"]);
	$documentRoot = $io->CombinePath($documentRoot);

	if (mb_strpos($path, $documentRoot) === 0)
	{
		$this->addUnformattedDetailError(
				"SECURITY_SITE_CHECKER_BITRIX_TMP_DIR",
				CSecurityCriticalLevel::MIDDLE,
				getMessage("SECURITY_SITE_CHECKER_BITRIX_TMP_DIR_ADDITIONAL", array(
						"#DIR#" => $path
				))
		);

		return static::STATUS_FAILED;
	}

	return static::STATUS_PASSED;
}