summaryrefslogtreecommitdiff
path: root/Command
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2013-10-05 13:30:13 -0400
committerGravatar Joey Hess <joey@kitenet.net>2013-10-05 13:30:13 -0400
commite8fcc7fbc9082e84713c4c5cac688623038a130d (patch)
tree1e33927769288bdc2d231989433626ce60800068 /Command
parentffc3902c811f2cfac893b100224e8d66c2f7de29 (diff)
addurl: Better sanitization of generated filenames.
Use sanitizeFilePath rather than rolling our own sanitizer.
Diffstat (limited to 'Command')
-rw-r--r--Command/AddUrl.hs4
1 files changed, 2 insertions, 2 deletions
diff --git a/Command/AddUrl.hs b/Command/AddUrl.hs
index 951bbdbe8..2379857dc 100644
--- a/Command/AddUrl.hs
+++ b/Command/AddUrl.hs
@@ -223,6 +223,6 @@ url2file url pathdepth pathmax = case pathdepth of
where
fullurl = uriRegName auth ++ uriPath url ++ uriQuery url
frombits a = intercalate "/" $ a urlbits
- urlbits = map (truncateFilePath pathmax . escape) $ filter (not . null) $ split "/" fullurl
+ urlbits = map (truncateFilePath pathmax . sanitizeFilePath) $
+ filter (not . null) $ split "/" fullurl
auth = fromMaybe (error $ "bad url " ++ show url) $ uriAuthority url
- escape = replace "/" "_" . replace "?" "_"