diff options
author | Arthur Schiwon <blizzz@owncloud.com> | 2013-09-05 11:58:57 +0200 |
---|---|---|
committer | Arthur Schiwon <blizzz@owncloud.com> | 2013-09-05 11:58:57 +0200 |
commit | c01675de5d6650c7b1cd0571d8c313f21d13c33c (patch) | |
tree | a1c3672af78c6e84d4e9fedab9cff0ef38620f2f /lib/files/storage | |
parent | ec3639dc7a28348b136d2008e692cffe8c3753ad (diff) | |
download | nextcloud-server-c01675de5d6650c7b1cd0571d8c313f21d13c33c.tar.gz nextcloud-server-c01675de5d6650c7b1cd0571d8c313f21d13c33c.zip |
more is_resource checks before readdir
Diffstat (limited to 'lib/files/storage')
-rw-r--r-- | lib/files/storage/mappedlocal.php | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/lib/files/storage/mappedlocal.php b/lib/files/storage/mappedlocal.php index fbf1b4ebf96..ba5ac4191c5 100644 --- a/lib/files/storage/mappedlocal.php +++ b/lib/files/storage/mappedlocal.php @@ -65,16 +65,18 @@ class MappedLocal extends \OC\Files\Storage\Common{ $logicalPath = $this->mapper->physicalToLogic($physicalPath); $dh = opendir($physicalPath); - while (($file = readdir($dh)) !== false) { - if ($file === '.' or $file === '..') { - continue; - } + if(is_resource($dh)) { + while (($file = readdir($dh)) !== false) { + if ($file === '.' or $file === '..') { + continue; + } - $logicalFilePath = $this->mapper->physicalToLogic($physicalPath.'/'.$file); + $logicalFilePath = $this->mapper->physicalToLogic($physicalPath.'/'.$file); - $file= $this->mapper->stripRootFolder($logicalFilePath, $logicalPath); - $file = $this->stripLeading($file); - $files[]= $file; + $file= $this->mapper->stripRootFolder($logicalFilePath, $logicalPath); + $file = $this->stripLeading($file); + $files[]= $file; + } } \OC\Files\Stream\Dir::register('local-win32'.$path, $files); |