diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2010-02-10 21:59:31 +0100 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2010-02-10 21:59:31 +0100 |
commit | 6c4eabfc4b686a72224ff06cb56c385bfc489790 (patch) | |
tree | 913239e4a2d994e813134b94f66a49eec9a4b201 /module/web/pyload | |
parent | webif patch #75 (thx kepheus) (diff) | |
download | pyload-6c4eabfc4b686a72224ff06cb56c385bfc489790.tar.xz |
Webinterface with lighttpd! locale fixing try.
Diffstat (limited to 'module/web/pyload')
-rw-r--r-- | module/web/pyload/urls.py | 2 | ||||
-rw-r--r-- | module/web/pyload/views.py | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/module/web/pyload/urls.py b/module/web/pyload/urls.py index 34c3aee18..420bc8ce1 100644 --- a/module/web/pyload/urls.py +++ b/module/web/pyload/urls.py @@ -9,7 +9,7 @@ from django.conf.urls.defaults import * urlpatterns = patterns('pyload', (r'^home/$', 'views.home'), (r'^downloads/$', 'views.downloads',{},'downloads'), - (r'^download/(?P<path>[a-zA-z\.0-9\-/_%]+)$', 'views.download',{},'download'), + (r'^download/(?P<path>[a-zA-z\.0-9\-/_% "\\]+)$', 'views.download',{},'download'), (r'^queue/$', 'views.queue',{}, 'queue'), (r'^collector/$', 'views.collector',{}, 'collector'), (r'^settings/$', 'views.config',{}, 'config'), diff --git a/module/web/pyload/views.py b/module/web/pyload/views.py index 2891b373d..e8df50596 100644 --- a/module/web/pyload/views.py +++ b/module/web/pyload/views.py @@ -7,6 +7,7 @@ from os import stat from os.path import isdir from os.path import isfile from os.path import join +from urllib import unquote from django.conf import settings from django.contrib.auth.decorators import login_required @@ -16,7 +17,6 @@ from django.shortcuts import render_to_response from django.template import RequestContext from django.utils.translation import ugettext as _ - def check_server(function): def _dec(view_func): def _view(request, * args, ** kwargs): @@ -110,14 +110,14 @@ def downloads(request): @permission('pyload.can_download') @check_server def download(request, path): + path = unquote(path) path = path.split("/") - + dir = join(settings.DL_ROOT, path[1].replace('..', '')) if isdir(dir) or isfile(dir): if isdir(dir): filepath = join(dir, path[2]) elif isfile(dir): filepath = dir - print filepath if isfile(filepath): try: type, encoding = mimetypes.guess_type(filepath) |