diff options
author | Joey Hess <joey@kitenet.net> | 2013-10-05 13:30:13 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2013-10-05 13:30:13 -0400 |
commit | e8fcc7fbc9082e84713c4c5cac688623038a130d (patch) | |
tree | 1e33927769288bdc2d231989433626ce60800068 /Command/AddUrl.hs | |
parent | ffc3902c811f2cfac893b100224e8d66c2f7de29 (diff) |
addurl: Better sanitization of generated filenames.
Use sanitizeFilePath rather than rolling our own sanitizer.
Diffstat (limited to 'Command/AddUrl.hs')
-rw-r--r-- | Command/AddUrl.hs | 4 |
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 "?" "_" |