core-bundle/src/Resources/contao/widgets/FileSelector.php
protected function isProtectedPath($path)
	{
		$rootDir = System::getContainer()->getParameter('kernel.project_dir');

		do
		{
			if (file_exists($rootDir . '/' . $path . '/.public'))
			{
				return false;
			}

			$path = \dirname($path);
		}
		while ($path != '.');

		return true;
	}
protected function isProtectedPath($path)
	{
		$rootDir = System::getContainer()->getParameter('kernel.project_dir');

		do
		{
			if (file_exists($rootDir . '/' . $path . '/.public'))
			{
				return false;
			}

			$path = \dirname($path);
		}
		while ($path != '.');

		return true;
	}
Check if a path is protected (see #287)

@param string $path

@return boolean