From 8af0a78c74b458b5d93269308e416b5c7c4efcbd Mon Sep 17 00:00:00 2001 From: Klaus-Uwe Mitterer Date: Sun, 21 Oct 2018 09:16:27 +0200 Subject: [PATCH] Fix frontend and input handling --- server/daemon.py | 13 +++++++------ server/static/index.html | 4 ++-- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/server/daemon.py b/server/daemon.py index 4e24b31..e72663f 100644 --- a/server/daemon.py +++ b/server/daemon.py @@ -40,33 +40,34 @@ def static(req): def addjob(req): jobid = str(uuid.uuid4()) config = configparser.ConfigParser() + try: - title = req.args["title"][0].replace(" ", "_") or "output" + title = re.sub(r"[^a-zA-Z0-9_\-]", "_", req.args["title"][0]) or output except: title = "output" try: - rx = req.args["rx"][0] + rx = int(req.args["rx"][0]) or 0 except: rx = 0 try: - ry = req.args["ry"][0] + ry = int(req.args["ry"][0]) or 0 except: ry = 0 try: - rz = req.args["rz"][0] + rz = int(req.args["rz"][0]) or 0 except: rz = 0 try: - width = req.args["width"][0] + width = int(req.args["width"][0]) or 3840 except: width = 3840 try: - height = req.args["height"][0] + height = int(req.args["height"][0]) or 1920 except: height = 1920 diff --git a/server/static/index.html b/server/static/index.html index 5863bcc..61aa28b 100644 --- a/server/static/index.html +++ b/server/static/index.html @@ -25,7 +25,7 @@
URL of an image contained in a krpano panorama or of a website containing a krpano panorama
-
x
+
x
/ /
- +