From 7ff4de408077e6aca97bb2cb900e19f673bb70a9 Mon Sep 17 00:00:00 2001 From: benpturner Date: Thu, 11 Oct 2018 10:31:51 +0100 Subject: [PATCH] 'Updated output-to-html to Encode HTML Chars' --- HTML.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/HTML.py b/HTML.py index 74af892..95243d6 100644 --- a/HTML.py +++ b/HTML.py @@ -1,6 +1,6 @@ #!/usr/bin/env python -import sqlite3, re, subprocess, time +import sqlite3, re, subprocess, time, html import pandas as pd from Config import * @@ -300,6 +300,13 @@ __________ .__. _________ ________ pd.set_option('display.max_colwidth', -1) pd.options.mode.chained_assignment = None frame = pd.read_sql_query("SELECT * FROM %s" % table, conn) + + # encode the Output column + if table == "CompletedTasks": + for index, row in frame.iterrows(): + frame.loc[index, "Output"] = html.escape(row["Output"]) + + # convert the random uri to original hostname if table == "CompletedTasks": framelen = frame['RandomURI'].count() for x in range(0, framelen):