Commit 70d10dba authored by Richard Weinhold's avatar Richard Weinhold 🎩

fixes ->list() throwing an AccessDeniedException

- Storage\Disk::list() throwed an AccessDeniedException if a file was
  not readable, before applying the storage-filter
parent 843d57f1
Pipeline #5793 passed with stages
in 21 seconds
......@@ -221,7 +221,7 @@ abstract class Storage
/**
* @param bool $recursive
* @return \Generator list of all files
* @throws RuntimeException|UnsupportedException
* @throws UnsupportedException
*/
public function list(bool $recursive = false): \Generator
{
......
......@@ -301,7 +301,7 @@ class Disk extends Storage
/**
* @inheritDoc
* @throws AccessDeniedException
* @throws RuntimeException
*/
public function list(bool $recursive = false): \Generator
{
......@@ -317,11 +317,6 @@ class Disk extends Storage
continue;
}
// file not readable
if (!$file->isReadable()) {
throw new AccessDeniedException(sprintf('unable to access file for path: "%s"', $file->getPathname()), 500);
}
yield new self(
$this->path->real,
str_replace($this->path->real, '', $file->getPathname())
......@@ -504,8 +499,9 @@ class Disk extends Storage
{
switch (true) {
// copy file from disk to disk
case $destination instanceof Disk:
// copy file from disk to disk
if (!\copy($this->path->real, $destination->path()->raw)) {
return false;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment