sanitize filepaths provided by checkUrl
This commit is contained in:
parent
b0ca0985ce
commit
67c05daf5e
5 changed files with 41 additions and 10 deletions
|
@ -73,11 +73,11 @@ seek us = do
|
|||
next $ next $ return False
|
||||
Right (UrlContents sz mf) -> do
|
||||
void $ commandAction $
|
||||
startRemote r relaxed (fromMaybe deffile mf) u sz
|
||||
startRemote r relaxed (maybe deffile fromSafeFilePath mf) u sz
|
||||
Right (UrlMulti l) ->
|
||||
forM_ l $ \(u', sz, f) ->
|
||||
void $ commandAction $
|
||||
startRemote r relaxed (deffile </> f) u' sz
|
||||
startRemote r relaxed (deffile </> fromSafeFilePath f) u' sz
|
||||
|
||||
startRemote :: Remote -> Bool -> FilePath -> URLString -> Maybe Integer -> CommandStart
|
||||
startRemote r relaxed file uri sz = do
|
||||
|
|
|
@ -156,7 +156,7 @@ performDownload relaxed cache todownload = case location todownload of
|
|||
downloadRemoteFile r relaxed url f sz
|
||||
Right (UrlMulti l) -> do
|
||||
kl <- forM l $ \(url', sz, subf) ->
|
||||
downloadRemoteFile r relaxed url' (f </> subf) sz
|
||||
downloadRemoteFile r relaxed url' (f </> fromSafeFilePath subf) sz
|
||||
return $ if all isJust kl
|
||||
then catMaybes kl
|
||||
else []
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue