Skip to content

Commit

Permalink
Only try to scan the children of directories
Browse files Browse the repository at this point in the history
  • Loading branch information
icewind1991 committed Feb 11, 2015
1 parent dc6468c commit 9bbfead
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/private/files/cache/scanner.php
Original file line number Diff line number Diff line change
Expand Up @@ -232,8 +232,8 @@ public function scan($path, $recursive = self::SCAN_RECURSIVE, $reuse = -1) {
$reuse = ($recursive === self::SCAN_SHALLOW) ? self::REUSE_ETAG | self::REUSE_SIZE : self::REUSE_ETAG;
}
$data = $this->scanFile($path, $reuse);
if ($data !== null) {
$size = $this->scanChildren($path, $recursive, $reuse);
if ($data and $data['mimetype'] === 'httpd/unix-directory') {
$size = $this->scanChildren($path, $recursive, $reuse, $data);
$data['size'] = $size;
}
return $data;
Expand Down Expand Up @@ -262,7 +262,7 @@ protected function getExistingChildren($folderId) {
*/
protected function getNewChildren($folder) {
$children = array();
if ($this->storage->is_dir($folder) && ($dh = $this->storage->opendir($folder))) {
if ($dh = $this->storage->opendir($folder)) {
if (is_resource($dh)) {
while (($file = readdir($dh)) !== false) {
if (!Filesystem::isIgnoredDir($file)) {
Expand Down

0 comments on commit 9bbfead

Please sign in to comment.