diff options
author | Nitzo <nitzo2001@yahoo.com> | 2016-01-09 22:05:19 +0100 |
---|---|---|
committer | Nitzo <nitzo2001@yahoo.com> | 2016-01-09 22:05:19 +0100 |
commit | 2de11b92076493e2490c0fe5e476ce14d234f6b8 (patch) | |
tree | 30c59562ce8a7257e12763fd7f3f08d7fdb29767 | |
parent | [Hoster] fix #2275, #2277 (diff) | |
download | pyload-2de11b92076493e2490c0fe5e476ce14d234f6b8.tar.xz |
[Misc] fix safepath
-rw-r--r-- | module/plugins/internal/misc.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/module/plugins/internal/misc.py b/module/plugins/internal/misc.py index 9b70c4b5a..f4491acf7 100644 --- a/module/plugins/internal/misc.py +++ b/module/plugins/internal/misc.py @@ -38,7 +38,7 @@ except ImportError: class misc(object): __name__ = "misc" __type__ = "plugin" - __version__ = "0.18" + __version__ = "0.19" __status__ = "stable" __pattern__ = r'^unmatchable$' @@ -475,10 +475,13 @@ def truncate(name, length): def safepath(value): """ Remove invalid characters and truncate the path if needed + + @NOTE: Returns absolute path """ + value = os.path.abspath(value) drive, filename = os.path.splitdrive(value) filename = os.path.join(os.sep, *map(safename, filename.split(os.sep))) - path = os.path.abspath(drive + filename) + path = drive + filename try: if os.name != "nt": |