From 2b353fa266c13b77b2c77af797dc28c8380b9443 Mon Sep 17 00:00:00 2001 From: RaNaN Date: Thu, 10 Feb 2011 23:43:10 +0100 Subject: more fixes --- module/web/json_app.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'module/web/json_app.py') diff --git a/module/web/json_app.py b/module/web/json_app.py index 12b7fa8ce..f10c09498 100644 --- a/module/web/json_app.py +++ b/module/web/json_app.py @@ -212,7 +212,8 @@ def link_order(ids): def add_package(): name = request.forms['add_name'] queue = int(request.forms['add_dest']) - links = request.forms['add_links'].split("\n") + links = request.forms['add_links'].decode("utf8", "ignore") + links = links.split("\n") pw = request.forms.get("add_password", "").strip("\n\r") try: @@ -232,11 +233,14 @@ def add_package(): if name is None or name == "": return HTTPError() + name = name.decode("utf8", "ignore") + links = map(lambda x: x.strip(), links) links = filter(lambda x: x != "", links) pack = PYLOAD.add_package(name, links, queue) if pw: + pw = pw.decode("utf8", "ignore") data = {"password": pw} PYLOAD.set_package_data(pack, data) -- cgit v1.2.3