From d0f19e435b5a3fecb3fd74b1ba0202364e6dc545 Mon Sep 17 00:00:00 2001 From: Jiri Moskovcak Date: Tue, 9 Feb 2010 21:51:20 +0100 Subject: GUI: escape plugin messages before using them in set_markup() - if the messages contain tags like it would break the markup and end-up with message like: GtkWarning: Failed to set text from markup due to error parsing markup --- src/Gui/CCMainWindow.py | 3 ++- 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 = "%s" % (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("%s" % report_status_dict[plugin][MESSAGE]) + status_label.set_markup("%s" % 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': -- cgit