summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2013-09-20 21:52:40 +0200
committerVincent Petry <pvince81@owncloud.com>2013-09-20 22:08:57 +0200
commit1962bed261c0124e2d0372bb093c16a510a8f102 (patch)
tree9aad87d458e02716843fb6bfd15b49396c7cde92 /apps
parent5b95e7aa0f0487d7ddb07588c71d25cd973c2bb6 (diff)
downloadnextcloud-server-1962bed261c0124e2d0372bb093c16a510a8f102.tar.gz
nextcloud-server-1962bed261c0124e2d0372bb093c16a510a8f102.zip
Replace plus sign with space in files app URL #4932
Some apps create URLs to the files app and encode the spaces of a directory using plus signs. This fix ensures that plus signs are properly converted back to spaces when parsing the URL on the JS side.
Diffstat (limited to 'apps')
-rw-r--r--apps/files/js/filelist.js8
1 files changed, 6 insertions, 2 deletions
diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js
index 4fc1b95a0ab..3c99e3876c7 100644
--- a/apps/files/js/filelist.js
+++ b/apps/files/js/filelist.js
@@ -895,6 +895,10 @@ $(document).ready(function(){
$(window).trigger('beforeunload');
});
+ function decodeQuery(query){
+ return query.replace(/\+/g, ' ');
+ }
+
function parseHashQuery(){
var hash = window.location.hash,
pos = hash.indexOf('?'),
@@ -911,11 +915,11 @@ $(document).ready(function(){
dir = '/';
// try and parse from URL hash first
if (query){
- params = OC.parseQueryString(query);
+ params = OC.parseQueryString(decodeQuery(query));
}
// else read from query attributes
if (!params){
- params = OC.parseQueryString(location.search);
+ params = OC.parseQueryString(decodeQuery(location.search));
}
return (params && params.dir) || '/';
}