mirror of
https://github.com/overleaf/overleaf.git
synced 2025-02-23 12:31:48 +00:00
Merge pull request #376 from sharelatex/ja-restrict-backslash
Don't allow backslashes in file names
This commit is contained in:
commit
a5480e5f9e
3 changed files with 7 additions and 6 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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"', ->
|
||||
|
|
Loading…
Reference in a new issue