mirror of
https://github.com/nextcloud/server.git
synced 2026-06-11 01:30:50 -04:00
Merge pull request #43830 from nextcloud/backport/43787/stable27
This commit is contained in:
commit
9b326c0c6d
1 changed files with 6 additions and 0 deletions
|
|
@ -61,6 +61,7 @@ use OCP\Files\ReservedWordException;
|
|||
use OCP\Files\Storage\ILockingStorage;
|
||||
use OCP\Files\Storage\IStorage;
|
||||
use OCP\Files\Storage\IWriteStreamStorage;
|
||||
use OCP\Files\StorageNotAvailableException;
|
||||
use OCP\Lock\ILockingProvider;
|
||||
use OCP\Lock\LockedException;
|
||||
use Psr\Log\LoggerInterface;
|
||||
|
|
@ -894,6 +895,11 @@ abstract class Common implements Storage, ILockingStorage, IWriteStreamStorage {
|
|||
|
||||
public function getDirectoryContent($directory): \Traversable {
|
||||
$dh = $this->opendir($directory);
|
||||
|
||||
if ($dh === false) {
|
||||
throw new StorageNotAvailableException('Directory listing failed');
|
||||
}
|
||||
|
||||
if (is_resource($dh)) {
|
||||
$basePath = rtrim($directory, '/');
|
||||
while (($file = readdir($dh)) !== false) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue