allow tab in controlCharacterInFilePath
Seems unlikely to have a tab in a path, but it's not a control character that needs to be prevented either. Left \n \r \v and \a as other non-threatening control characters that are still obnoxious to have in a filepath because of how it causes issues with display and/or with shell scripting.
This commit is contained in:
parent
ad71f005b8
commit
de68e3dd4f
1 changed files with 6 additions and 1 deletions
|
@ -53,7 +53,12 @@ sanitizeLeadingFilePathCharacter ('/':s) = '_':s
|
||||||
sanitizeLeadingFilePathCharacter s = s
|
sanitizeLeadingFilePathCharacter s = s
|
||||||
|
|
||||||
controlCharacterInFilePath :: FilePath -> Bool
|
controlCharacterInFilePath :: FilePath -> Bool
|
||||||
controlCharacterInFilePath = any isControl
|
controlCharacterInFilePath = any (not . safechar)
|
||||||
|
where
|
||||||
|
safechar c
|
||||||
|
| not (isControl c) = True
|
||||||
|
| c == '\t' = True
|
||||||
|
| otherwise = False
|
||||||
|
|
||||||
{- ../ is a path traversal, no matter where it appears.
|
{- ../ is a path traversal, no matter where it appears.
|
||||||
-
|
-
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue