Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib/files
diff options
context:
space:
mode:
authorBjoern Schiessle <schiessle@owncloud.com>2013-10-24 14:26:38 +0400
committerBjoern Schiessle <schiessle@owncloud.com>2013-10-24 14:26:38 +0400
commit80ec5466a705df3199d5ea0e087ff9aaa91caa06 (patch)
tree3c201344962aba19ed921812912d0402f8fef45c /lib/files
parent20d22ece2bac4fac7cec7609ec6f18cdd60af8ea (diff)
return -1 if file is empty otherwise we run into infinite loops
Diffstat (limited to 'lib/files')
-rw-r--r--lib/files/cache/cache.php6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/files/cache/cache.php b/lib/files/cache/cache.php
index 76e1ee97727..bd2f774190d 100644
--- a/lib/files/cache/cache.php
+++ b/lib/files/cache/cache.php
@@ -287,6 +287,10 @@ class Cache {
* @return int
*/
public function getId($file) {
+ // if no file is given return -1
+ if ($file === '') {
+ return -1;
+ }
// normalize path
$file = $this->normalize($file);
@@ -518,7 +522,7 @@ class Cache {
if ($entry['size'] !== $totalSize) {
$this->update($id, array('size' => $totalSize));
}
-
+
}
}
return $totalSize;