Merge pull request #376 from sharelatex/ja-restrict-backslash

Don't allow backslashes in file names
This commit is contained in:
James Allen 2018-03-01 15:10:05 +00:00 committed by GitHub
commit a5480e5f9e
3 changed files with 7 additions and 6 deletions

View file

@ -7,7 +7,8 @@
load = () ->
BADCHAR_RX = ///
[
\/ # no slashes
\/ # no forward slashes
\\ # no back slashes
\* # no asterisk
\u0000-\u001F # no control characters (0-31)
\u007F # no delete

View file

@ -7,7 +7,8 @@
load = () ->
BADCHAR_RX = ///
[
\/ # no slashes
\/ # no forward slashes
\\ # no back slashes
\* # no asterisk
\u0000-\u001F # no control characters (0-31)
\u007F # no delete

View file

@ -79,10 +79,9 @@ describe 'SafePath', ->
# result = @SafePath.isCleanFilename 'hello.'
# result.should.equal false
# it 'should not accept \\', ->
# result = @SafePath.isCleanFilename 'foo\\bar'
# result.should.equal false
it 'should not accept \\', ->
result = @SafePath.isCleanFilename 'foo\\bar'
result.should.equal false
describe 'isAllowedLength', ->
it 'should accept a valid path "main.tex"', ->