Skip to content
Permalink
Browse files Browse the repository at this point in the history
Also prevent null byte character
  • Loading branch information
nickvergessen committed Sep 1, 2016
1 parent 778ae8a commit 5dd211c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion apps/files/js/filelist.js
Expand Up @@ -1339,7 +1339,8 @@
}
}

return path.toLowerCase().indexOf(decodeURI('%0a')) === -1;
return path.toLowerCase().indexOf(decodeURI('%0a')) === -1 &&
path.toLowerCase().indexOf(decodeURI('%00')) === -1;
},

/**
Expand Down
1 change: 1 addition & 0 deletions apps/files/tests/js/filelistSpec.js
Expand Up @@ -1334,6 +1334,7 @@ describe('OCA.Files.FileList tests', function() {
'/abc/../',
'/../abc/',
'/foo%0Abar/',
'/foo%00bar/',
'/another\\subdir/../foo\\../bar\\..\\file/..\\folder/../'
], function(path) {
fileList.changeDirectory(decodeURI(path));
Expand Down

0 comments on commit 5dd211c

Please sign in to comment.