diff options
Diffstat (limited to 'module/Api.py')
-rw-r--r-- | module/Api.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/module/Api.py b/module/Api.py index 11b06ff32..fba02d574 100644 --- a/module/Api.py +++ b/module/Api.py @@ -19,7 +19,7 @@ import re from base64 import standard_b64encode -from os.path import join +from os.path import join, isabs from time import time from itertools import chain @@ -300,7 +300,10 @@ class Api(Iface): else: folder = "" - folder = folder.replace("http://", "").replace(":", "").replace("\\", "_") #.replace("/", "_") + if isabs(folder): + folder = folder.replace("/", "_") + + folder = folder.replace("http://", "").replace(":", "").replace("\\", "_").replace("..", "") self.core.log.info(_("Added package %(name)s containing %(count)d links") % {"name": name, "count": len(links)}) pid = self.core.files.addPackage(name, folder, dest, password) |