summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2014-02-10 12:14:05 +0100
committerVincent Petry <pvince81@owncloud.com>2014-02-10 12:14:05 +0100
commit6b5a7035ee4aa5306ccd13a5e0909f786697e588 (patch)
tree2591192202f14c0d14012fbfab87a3917bb079e4
parente156f85bfb7ea1b6d74227a49507e1a3b0e0e374 (diff)
parentaf7366cd30f0df27cc1043f2c2b55def836d03db (diff)
downloadnextcloud-server-6b5a7035ee4aa5306ccd13a5e0909f786697e588.tar.gz
nextcloud-server-6b5a7035ee4aa5306ccd13a5e0909f786697e588.zip
Merge pull request #7126 from nickvergessen/issue/6683
Only add files to file list when uploading to current directory
-rw-r--r--apps/files/ajax/upload.php6
-rw-r--r--apps/files/js/filelist.js4
2 files changed, 6 insertions, 4 deletions
diff --git a/apps/files/ajax/upload.php b/apps/files/ajax/upload.php
index 8f6c42d6620..754c34ef088 100644
--- a/apps/files/ajax/upload.php
+++ b/apps/files/ajax/upload.php
@@ -139,7 +139,8 @@ if (strpos($dir, '..') === false) {
'originalname' => $files['tmp_name'][$i],
'uploadMaxFilesize' => $maxUploadFileSize,
'maxHumanFilesize' => $maxHumanFileSize,
- 'permissions' => $meta['permissions'] & $allowedPermissions
+ 'permissions' => $meta['permissions'] & $allowedPermissions,
+ 'directory' => \OC\Files\Filesystem::normalizePath(stripslashes($dir)),
);
}
@@ -166,7 +167,8 @@ if (strpos($dir, '..') === false) {
'originalname' => $files['tmp_name'][$i],
'uploadMaxFilesize' => $maxUploadFileSize,
'maxHumanFilesize' => $maxHumanFileSize,
- 'permissions' => $meta['permissions'] & $allowedPermissions
+ 'permissions' => $meta['permissions'] & $allowedPermissions,
+ 'directory' => \OC\Files\Filesystem::normalizePath(stripslashes($dir)),
);
}
}
diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js
index 2883218b2cc..a855d6cbe59 100644
--- a/apps/files/js/filelist.js
+++ b/apps/files/js/filelist.js
@@ -922,8 +922,8 @@ $(document).ready(function() {
data.context.find('td.filesize').text(humanFileSize(size));
} else {
- // only append new file if dragged onto current dir's crumb (last)
- if (data.context && data.context.hasClass('crumb') && !data.context.hasClass('last')) {
+ // only append new file if uploaded into the current folder
+ if (file.directory !== FileList.getCurrentDirectory()) {
return;
}