From 4e5731c58becec8043cb2de5c3b9214f1f8cc849 Mon Sep 17 00:00:00 2001 From: Ivan Alejandro Date: Mon, 4 Nov 2013 19:26:15 -0300 Subject: Support html logs in the logger window. Escape special characters to display them correctly in the logger window. [Closes #4146] --- changes/bug-4146_logger-window-html-support | 2 ++ src/leap/bitmask/gui/loggerwindow.py | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 changes/bug-4146_logger-window-html-support diff --git a/changes/bug-4146_logger-window-html-support b/changes/bug-4146_logger-window-html-support new file mode 100644 index 00000000..27615d86 --- /dev/null +++ b/changes/bug-4146_logger-window-html-support @@ -0,0 +1,2 @@ +- Escape logs with html contents so they get displayed in plaintext + on the log viewer. Closes #4146. diff --git a/src/leap/bitmask/gui/loggerwindow.py b/src/leap/bitmask/gui/loggerwindow.py index ad2ceded..6ef58558 100644 --- a/src/leap/bitmask/gui/loggerwindow.py +++ b/src/leap/bitmask/gui/loggerwindow.py @@ -19,6 +19,7 @@ History log window """ import logging +import cgi from PySide import QtGui @@ -90,7 +91,7 @@ class LoggerWindow(QtGui.QDialog): logging.CRITICAL: "background: red; color: white; font: bold;" } level = log[LeapLogHandler.RECORD_KEY].levelno - message = log[LeapLogHandler.MESSAGE_KEY] + message = cgi.escape(log[LeapLogHandler.MESSAGE_KEY]) if self._logs_to_display[level]: open_tag = "" -- cgit v1.2.3