mirror of
https://github.com/DirectoryLister/DirectoryLister.git
synced 2025-08-29 08:40:42 +02:00
Removed DirectoryController::isRoot() method
This commit is contained in:
@@ -64,24 +64,11 @@ class DirectoryController
|
||||
sprintf('/(?:.*)%s(?:.*)/i', preg_quote($search, '/'))
|
||||
) : $files->depth(0),
|
||||
'path' => $path,
|
||||
'is_root' => $this->isRoot($path),
|
||||
'readme' => $this->readme($path),
|
||||
'search' => $search,
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if a provided path is the root path.
|
||||
*
|
||||
* @param string $path
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
protected function isRoot(string $path): bool
|
||||
{
|
||||
return realpath($path) === realpath($this->container->get('base_path'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the README file for a given path.
|
||||
*
|
||||
|
@@ -21,7 +21,7 @@
|
||||
|
||||
<ul id="file-list">
|
||||
<li>
|
||||
{% if not search and not is_root %}
|
||||
{% if not search and path != '.' %}
|
||||
{{ include('components/file.twig', { parentDir: true }) }}
|
||||
{% endif %}
|
||||
</li>
|
||||
|
Reference in New Issue
Block a user