aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2018-01-10 21:00:19 +0100
committerGitHub <noreply@github.com>2018-01-10 21:00:19 +0100
commit00a823f62e9e4a11a6d3f7eadc72a3b4fe3ebd07 (patch)
treee22861189dc959bd3d1133ad546a3e99c12cf884
parent03a7d9bbfafa10934f4d94216a3f174a5dcffab4 (diff)
parentd4f163b2300b5190366f38b51d4e7a80fde6d235 (diff)
downloadnextcloud-server-00a823f62e9e4a11a6d3f7eadc72a3b4fe3ebd07.tar.gz
nextcloud-server-00a823f62e9e4a11a6d3f7eadc72a3b4fe3ebd07.zip
Merge pull request #7765 from nextcloud/fix_5574
Don't encode paths that will be passed to the davclient
-rw-r--r--apps/dav/lib/Upload/UploadHome.php3
-rw-r--r--apps/files/js/file-upload.js14
2 files changed, 9 insertions, 8 deletions
diff --git a/apps/dav/lib/Upload/UploadHome.php b/apps/dav/lib/Upload/UploadHome.php
index 9f4ae0e8a2c..ec31e93f4f9 100644
--- a/apps/dav/lib/Upload/UploadHome.php
+++ b/apps/dav/lib/Upload/UploadHome.php
@@ -66,7 +66,8 @@ class UploadHome implements ICollection {
}
function getName() {
- return 'uploads';
+ list(,$name) = \Sabre\Uri\split($this->principalInfo['uri']);
+ return $name;
}
function setName($name) {
diff --git a/apps/files/js/file-upload.js b/apps/files/js/file-upload.js
index 8e95abcb5e8..ad56492730e 100644
--- a/apps/files/js/file-upload.js
+++ b/apps/files/js/file-upload.js
@@ -235,7 +235,7 @@ OC.FileUpload.prototype = {
) {
data.isChunked = true;
chunkFolderPromise = this.uploader.davClient.createDirectory(
- 'uploads/' + encodeURIComponent(OC.getCurrentUser().uid) + '/' + encodeURIComponent(this.getId())
+ 'uploads/' + OC.getCurrentUser().uid + '/' + this.getId()
);
// TODO: if fails, it means same id already existed, need to retry
} else {
@@ -272,8 +272,8 @@ OC.FileUpload.prototype = {
}
return this.uploader.davClient.move(
- 'uploads/' + encodeURIComponent(uid) + '/' + encodeURIComponent(this.getId()) + '/.file',
- 'files/' + encodeURIComponent(uid) + '/' + OC.joinPaths(this.getFullPath(), this.getFileName()),
+ 'uploads/' + uid + '/' + this.getId() + '/.file',
+ 'files/' + uid + '/' + OC.joinPaths(this.getFullPath(), this.getFileName()),
true,
headers
);
@@ -282,7 +282,7 @@ OC.FileUpload.prototype = {
_deleteChunkFolder: function() {
// delete transfer directory for this upload
this.uploader.davClient.remove(
- 'uploads/' + encodeURIComponent(OC.getCurrentUser().uid) + '/' + encodeURIComponent(this.getId())
+ 'uploads/' + OC.getCurrentUser().uid + '/' + this.getId()
);
},
@@ -1166,9 +1166,9 @@ OC.Uploader.prototype = _.extend({
var chunkId = range.split('/')[0].split('-')[0];
data.url = OC.getRootPath() +
'/remote.php/dav/uploads' +
- '/' + encodeURIComponent(OC.getCurrentUser().uid) +
- '/' + encodeURIComponent(upload.getId()) +
- '/' + encodeURIComponent(chunkId);
+ '/' + OC.getCurrentUser().uid +
+ '/' + upload.getId() +
+ '/' + chunkId;
delete data.contentRange;
delete data.headers['Content-Range'];
});