Filter out %0A from paths
This commit is contained in:
parent
e6c8c33b03
commit
ed0f0db5fa
|
@ -1400,6 +1400,10 @@
|
|||
return OC.linkTo('files', 'index.php')+"?dir="+ encodeURIComponent(dir).replace(/%2F/g, '/');
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {string} path
|
||||
* @returns {boolean}
|
||||
*/
|
||||
_isValidPath: function(path) {
|
||||
var sections = path.split('/');
|
||||
for (var i = 0; i < sections.length; i++) {
|
||||
|
@ -1407,7 +1411,8 @@
|
|||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
||||
return path.toLowerCase().indexOf(decodeURI('%0a')) === -1;
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
|
@ -1379,9 +1379,10 @@ describe('OCA.Files.FileList tests', function() {
|
|||
'/abc/..',
|
||||
'/abc/../',
|
||||
'/../abc/',
|
||||
'/foo%0Abar/',
|
||||
'/another\\subdir/../foo\\../bar\\..\\file/..\\folder/../'
|
||||
], function(path) {
|
||||
fileList.changeDirectory(path);
|
||||
fileList.changeDirectory(decodeURI(path));
|
||||
expect(fileList.getCurrentDirectory()).toEqual('/');
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue