Also prevent null byte character

This commit is contained in:
Joas Schilling 2016-09-01 12:24:14 +02:00
parent ed0f0db5fa
commit c3ae21fef2
No known key found for this signature in database
GPG Key ID: E166FD8976B3BAC8
2 changed files with 3 additions and 1 deletions

View File

@ -1412,7 +1412,8 @@
}
}
return path.toLowerCase().indexOf(decodeURI('%0a')) === -1;
return path.toLowerCase().indexOf(decodeURI('%0a')) === -1 &&
path.toLowerCase().indexOf(decodeURI('%00')) === -1;
},
/**

View File

@ -1380,6 +1380,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));