aboutsummaryrefslogtreecommitdiffstats
path: root/lib/files/cache
diff options
context:
space:
mode:
authorThomas Mueller <thomas.mueller@tmit.eu>2013-02-11 21:42:27 +0100
committerThomas Mueller <thomas.mueller@tmit.eu>2013-02-11 21:42:27 +0100
commit037fcde1334d7b4d2bdeaaad0a71adc692b27ff8 (patch)
tree6f10b1a8d54cfea8cc3adf343de0bbf0f115f3d2 /lib/files/cache
parentf58ed7a509da54fcd29e21dc6fc75528822157a4 (diff)
parent58e57151e51a02788377f761b183c15cd03b0ef0 (diff)
downloadnextcloud-server-037fcde1334d7b4d2bdeaaad0a71adc692b27ff8.tar.gz
nextcloud-server-037fcde1334d7b4d2bdeaaad0a71adc692b27ff8.zip
Merge branch 'master' into fixing-1424-master
Diffstat (limited to 'lib/files/cache')
-rw-r--r--lib/files/cache/scanner.php18
1 files changed, 17 insertions, 1 deletions
diff --git a/lib/files/cache/scanner.php b/lib/files/cache/scanner.php
index 9a5546dce3f..5a9a119458e 100644
--- a/lib/files/cache/scanner.php
+++ b/lib/files/cache/scanner.php
@@ -97,7 +97,7 @@ class Scanner {
if ($this->storage->is_dir($path) && ($dh = $this->storage->opendir($path))) {
\OC_DB::beginTransaction();
while ($file = readdir($dh)) {
- if ($file !== '.' and $file !== '..') {
+ if (!$this->isIgnoredFile($file)) {
$child = ($path) ? $path . '/' . $file : $file;
$data = $this->scanFile($child);
if ($data) {
@@ -133,6 +133,22 @@ class Scanner {
}
return $size;
}
+
+ /**
+ * @brief check if the file should be ignored when scanning
+ * NOTE: files with a '.part' extension are ignored as well!
+ * prevents unfinished put requests to be scanned
+ * @param String $file
+ * @return boolean
+ */
+ private function isIgnoredFile($file) {
+ if ($file === '.' || $file === '..'
+ || pathinfo($file,PATHINFO_EXTENSION) === 'part')
+ {
+ return true;
+ }
+ return false;
+ }
/**
* walk over any folders that are not fully scanned yet and scan them