diff options
author | Robin Appelman <icewind@owncloud.com> | 2012-12-02 03:43:51 +0100 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2012-12-02 03:43:51 +0100 |
commit | 01eb5d2790638ab836adc95a9726b6a1003562b9 (patch) | |
tree | b0337019d2b3f2078da332c7d3a59c45063f8248 /lib/files/cache/scanner.php | |
parent | 72b6faa69d693fa0d2a21d592b6ae36023757872 (diff) | |
download | nextcloud-server-01eb5d2790638ab836adc95a9726b6a1003562b9.tar.gz nextcloud-server-01eb5d2790638ab836adc95a9726b6a1003562b9.zip |
fix some edge cases while scanning the root of a storage
Diffstat (limited to 'lib/files/cache/scanner.php')
-rw-r--r-- | lib/files/cache/scanner.php | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/files/cache/scanner.php b/lib/files/cache/scanner.php index 9ee509bb132..4c0ec9617f9 100644 --- a/lib/files/cache/scanner.php +++ b/lib/files/cache/scanner.php @@ -71,7 +71,7 @@ class Scanner { \OC_Hook::emit('\OC\Files\Cache\Scanner', 'scan_file', array('path' => $file, 'storage' => $this->storageId)); $data = $this->getData($file); if ($data) { - if ($file !== '') { + if ($file) { $parent = dirname($file); if ($parent === '.') { $parent = ''; @@ -101,7 +101,7 @@ class Scanner { if ($dh = $this->storage->opendir($path)) { while ($file = readdir($dh)) { if ($file !== '.' and $file !== '..') { - $child = ($path !== '') ? $path . '/' . $file : $file; + $child = ($path) ? $path . '/' . $file : $file; $data = $this->scanFile($child); if ($data) { if ($data['mimetype'] === 'httpd/unix-directory') { |