Skip to content
Snippets Groups Projects
Commit 743c330f authored by Thomas Müller's avatar Thomas Müller
Browse files

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 
parents 29361408 42d59d5a
Branches
No related tags found
No related merge requests found
......@@ -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);
......
......@@ -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 !== '..') {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment