From e8fcc7fbc9082e84713c4c5cac688623038a130d Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 5 Oct 2013 13:30:13 -0400 Subject: addurl: Better sanitization of generated filenames. Use sanitizeFilePath rather than rolling our own sanitizer. --- Command/AddUrl.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Command') 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 "?" "_" -- cgit v1.2.3