Browse Source

fix directory existion check #2

main
ghost 1 year ago
parent
commit
17d6171d95
  1. 27
      src/webui/explore.php

27
src/webui/explore.php

@ -89,19 +89,23 @@ $filepath = implode( @@ -89,19 +89,23 @@ $filepath = implode(
/// Local snaps
if ($config->snap->storage->local->enabled)
{
/// absolute
if ('/' === substr($config->snap->storage->local->directory, 0, 1))
{
$prefix = $config->snap->storage->local->directory;
}
/// absolute
if ('/' === substr($config->snap->storage->local->directory, 0, 1))
{
$prefix = $config->snap->storage->local->directory;
}
/// relative
else
{
$prefix = __DIR__ . '/../../' . $config->snap->storage->local->directory;
}
/// relative
else
{
$prefix = __DIR__ . '/../../' . $config->snap->storage->local->directory;
}
$directory = sprintf('%s/%s', $prefix, $filepath);
foreach ((array) scandir(sprintf('%s/%s', $prefix, $filepath)) as $filename)
if (is_dir($directory))
{
foreach ((array) scandir($directory) as $filename)
{
if (in_array($filename, ['.', '..']))
{
@ -126,6 +130,7 @@ if ($config->snap->storage->local->enabled) @@ -126,6 +130,7 @@ if ($config->snap->storage->local->enabled)
),
];
}
}
}
/// Remote snaps

Loading…
Cancel
Save