diff options
author | Jiri Moskovcak <jmoskovc@redhat.com> | 2010-02-09 21:51:20 +0100 |
---|---|---|
committer | Jiri Moskovcak <jmoskovc@redhat.com> | 2010-02-09 21:51:20 +0100 |
commit | d0f19e435b5a3fecb3fd74b1ba0202364e6dc545 (patch) | |
tree | a6615498d511b0fd5302b78d0a9721fdaeb46dae | |
parent | 4df13ffe0f3b9952dcd68263fb51cac842b193b1 (diff) | |
download | abrt-d0f19e435b5a3fecb3fd74b1ba0202364e6dc545.tar.gz abrt-d0f19e435b5a3fecb3fd74b1ba0202364e6dc545.tar.xz abrt-d0f19e435b5a3fecb3fd74b1ba0202364e6dc545.zip |
GUI: escape plugin messages before using them in set_markup()
- if the messages contain tags like <foo> it would
break the markup and end-up with message like:
GtkWarning: Failed to set text from markup due to error parsing markup
-rw-r--r-- | src/Gui/CCMainWindow.py | 3 | ||||
-rw-r--r-- | src/Gui/CC_gui_functions.py | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/src/Gui/CCMainWindow.py b/src/Gui/CCMainWindow.py index 7967028..c0666f0 100644 --- a/src/Gui/CCMainWindow.py +++ b/src/Gui/CCMainWindow.py @@ -2,6 +2,7 @@ import sys import pwd import getopt +from glib import markup_escape_text from abrt_utils import _, init_logging, log, log1, log2 import gobject @@ -233,7 +234,7 @@ class MainWindow(): # it is not informative (no URL to the report) for message in dump.getMessage().split(';'): if message: - message_clean = message.strip() + message_clean = markup_escape_text(message.strip()) if "http" in message_clean[0:5] or "file:///" in message_clean[0:8]: report_message = "<a href=\"%s\">%s</a>" % (message_clean, message_clean) else: diff --git a/src/Gui/CC_gui_functions.py b/src/Gui/CC_gui_functions.py index 9378de5..acfd2a5 100644 --- a/src/Gui/CC_gui_functions.py +++ b/src/Gui/CC_gui_functions.py @@ -1,4 +1,5 @@ # -*- coding: utf-8 -*- +from glib import markup_escape_text import gtk import pango import subprocess @@ -66,7 +67,7 @@ def gui_report_dialog ( report_status_dict, parent_dialog, # this first one is actually a fallback to set at least # a raw text in case when set_markup() fails status_label.set_text(report_status_dict[plugin][MESSAGE]) - status_label.set_markup("<span foreground='red'>%s</span>" % report_status_dict[plugin][MESSAGE]) + status_label.set_markup("<span foreground='red'>%s</span>" % markup_escape_text(report_status_dict[plugin][MESSAGE])) # if the report was not succesful then this won't pass so this runs only # if report succeds and gets overwriten by the status message if report_status_dict[plugin][STATUS] == '1': |