aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2013-02-03 00:24:49 -0800
committerThomas Müller <thomas.mueller@tmit.eu>2013-02-03 00:24:49 -0800
commit743c330f0353d6207a456a5e51ee9a81573e6b14 (patch)
treed0b50352501b00469901623972298328aa24e909
parent2936140838f479751662e34892fad3f2af6bff90 (diff)
parent42d59d5a1658dde5d428ae855de524411c311048 (diff)
downloadnextcloud-server-743c330f0353d6207a456a5e51ee9a81573e6b14.tar.gz
nextcloud-server-743c330f0353d6207a456a5e51ee9a81573e6b14.zip
Merge pull request #1422 from TheSFReader/master
Correct the Cache Scanner so that it doesn't try and scan subdirs of a non-dir path when renaming
-rw-r--r--apps/files/ajax/upload.php3
-rw-r--r--lib/files/cache/scanner.php2
2 files changed, 3 insertions, 2 deletions
diff --git a/apps/files/ajax/upload.php b/apps/files/ajax/upload.php
index 9ecc1a6c2f4..676612c0e42 100644
--- a/apps/files/ajax/upload.php
+++ b/apps/files/ajax/upload.php
@@ -10,6 +10,8 @@ OCP\JSON::checkLoggedIn();
OCP\JSON::callCheck();
$l = OC_L10N::get('files');
+
+$dir = $_POST['dir'];
// get array with current storage stats (e.g. max file size)
$storageStats = \OCA\files\lib\Helper::buildFileStorageStatistics($dir);
@@ -37,7 +39,6 @@ foreach ($_FILES['files']['error'] as $error) {
}
$files = $_FILES['files'];
-$dir = $_POST['dir'];
$error = '';
$maxUploadFilesize = OCP\Util::maxUploadFilesize($dir);
diff --git a/lib/files/cache/scanner.php b/lib/files/cache/scanner.php
index bf0ef01d6b3..8d504af6163 100644
--- a/lib/files/cache/scanner.php
+++ b/lib/files/cache/scanner.php
@@ -94,7 +94,7 @@ class Scanner {
}
$size = 0;
- if ($dh = $this->storage->opendir($path)) {
+ if ($this->storage->is_dir($path) && ($dh = $this->storage->opendir($path))) {
\OC_DB::beginTransaction();
while ($file = readdir($dh)) {
if ($file !== '.' and $file !== '..') {