summaryrefslogtreecommitdiff
path: root/Utility
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2013-12-27 17:52:20 -0400
committerGravatar Joey Hess <joey@kitenet.net>2013-12-27 17:52:20 -0400
commit9e53aca36b2b709034dc3ff57827a964e4a8a3d8 (patch)
tree7d72f4ffb9ea420be76e1ea8d8a9a451672ea32f /Utility
parent9dc4ae46a6aac0d107c30b98bf137bc0dd5a4963 (diff)
addurl, importfeed: Sanitize | and some other symbols and special characters.
Diffstat (limited to 'Utility')
-rw-r--r--Utility/Path.hs6
1 files changed, 3 insertions, 3 deletions
diff --git a/Utility/Path.hs b/Utility/Path.hs
index b6214b247..44ac72f06 100644
--- a/Utility/Path.hs
+++ b/Utility/Path.hs
@@ -242,13 +242,13 @@ fileNameLengthLimit dir = do
- was provided by a third party and is not to be trusted, returns the closest
- sane FilePath.
-
- - All spaces and punctuation are replaced with '_', except for '.'
- - "../" will thus turn into ".._", which is safe.
+ - All spaces and punctuation and other wacky stuff are replaced
+ - with '_', except for '.' "../" will thus turn into ".._", which is safe.
-}
sanitizeFilePath :: String -> FilePath
sanitizeFilePath = map sanitize
where
sanitize c
| c == '.' = c
- | isSpace c || isPunctuation c || c == '/' = '_'
+ | isSpace c || isPunctuation c || isSymbol c || isControl c || c == '/' = '_'
| otherwise = c