From f55aaad858396484d35f87ca09e5f53e9848ddf6 Mon Sep 17 00:00:00 2001
From: Florin Peter <fp@datawerk.de>
Date: Mon, 29 Apr 2013 15:43:48 +0200
Subject: [PATCH] fix for infinite loop causing on files_encryption branch when
 testing "apps/files_encryption/test/crypt.php" on Method
 testSymmetricStreamEncryptShortFileContent

---
 lib/files/cache/cache.php   | 2 +-
 lib/files/cache/scanner.php | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/files/cache/cache.php b/lib/files/cache/cache.php
index 857fe980be..47f3c272b1 100644
--- a/lib/files/cache/cache.php
+++ b/lib/files/cache/cache.php
@@ -430,7 +430,7 @@ class Cache {
 		$this->calculateFolderSize($path);
 		if ($path !== '') {
 			$parent = dirname($path);
-			if ($parent === '.') {
+			if ($parent === '.' or $parent === '/') {
 				$parent = '';
 			}
 			$this->correctFolderSize($parent);
diff --git a/lib/files/cache/scanner.php b/lib/files/cache/scanner.php
index f019d4fc60..5241acec1e 100644
--- a/lib/files/cache/scanner.php
+++ b/lib/files/cache/scanner.php
@@ -68,7 +68,7 @@ class Scanner {
 			if ($data) {
 				if ($file) {
 					$parent = dirname($file);
-					if ($parent === '.') {
+					if ($parent === '.' or $parent === '/') {
 						$parent = '';
 					}
 					if (!$this->cache->inCache($parent)) {
-- 
GitLab