From e99f16300f835388fbfc6cdc044296ca37b0d4fd Mon Sep 17 00:00:00 2001 From: 2Shirt <2xShirt@gmail.com> Date: Wed, 29 May 2019 20:01:16 -0600 Subject: [PATCH] Escape single quotes before posting to osTicket * Only done for the post body for now --- .bin/Scripts/functions/osticket.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.bin/Scripts/functions/osticket.py b/.bin/Scripts/functions/osticket.py index f7ab8b77..4b3c5adf 100644 --- a/.bin/Scripts/functions/osticket.py +++ b/.bin/Scripts/functions/osticket.py @@ -524,7 +524,7 @@ class osTicket(): sql_cmd += " VALUES (" sql_cmd += " '{}',".format(ticket_id) sql_cmd += " '{ID}', '{Name}',".format(**OSTICKET['Staff']) - sql_cmd += " '{}',".format(response) + sql_cmd += " '{}',".format(response.replace("'", "\\'")) sql_cmd += " '{}'".format(time.strftime("%Y-%m-%d %H:%M:%S")) sql_cmd += " );"