mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-30 20:31:34 +02:00
Merge pull request #376 from sharelatex/ja-restrict-backslash
Don't allow backslashes in file names
This commit is contained in:
@@ -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"', ->
|
||||
|
||||
Reference in New Issue
Block a user