addurl: Better sanitization of generated filenames.
Use sanitizeFilePath rather than rolling our own sanitizer.
This commit is contained in:
parent
cf428895a2
commit
478eeea02e
2 changed files with 3 additions and 2 deletions
|
@ -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 "?" "_"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue