From 08599ce2a398d4de8f2d72f4459c326e2b7fb563 Mon Sep 17 00:00:00 2001 From: iou1name Date: Thu, 21 Jun 2018 22:49:25 -0400 Subject: [PATCH] minor sanitization for post editing --- events.py | 4 ++++ templates/quest.html | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/events.py b/events.py index cc7fc7c..5241e0f 100644 --- a/events.py +++ b/events.py @@ -54,6 +54,7 @@ def new_post(data): """ Called when the QM makes a new post. """ + print(data) room = data["room"] res = db.get_quest_meta(quest_id=room) if not res: @@ -83,6 +84,9 @@ def update_post(data): return post = data["post"] + post = post.strip().replace("
", "
") + data["post"] = post + post_id = data["post_id"] db.update_quest_post(post_id, post) emit("update_post", data, room=room) diff --git a/templates/quest.html b/templates/quest.html index 9c02e04..d3f9953 100644 --- a/templates/quest.html +++ b/templates/quest.html @@ -3,6 +3,7 @@ {% block head %}