Treferwynd / transmission-remote-gtk

Automatically exported from code.google.com/p/transmission-remote-gtk
GNU General Public License v2.0
0 stars 0 forks source link

Setting markuped text without escaping #208

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I've figured out the reason of warning I've mentioned in 
http://code.google.com/p/transmission-remote-gtk/issues/detail?id=204#c3.

It seems the changes 
http://code.google.com/p/transmission-remote-gtk/source/detail?r=9e8fed99f309 
should be extended.

Something like:

--- transmission-remote-gtk-1.0.2/src/trg-general-panel.c   2012-06-29 
16:35:43.000000000 +0200
+++ transmission-remote-gtk-new/src/trg-general-panel.c 2012-07-31 
19:55:26.515097954 +0200
@@ -113,7 +113,7 @@ trg_general_panel_update(TrgGeneralPanel
     TrgGeneralPanelPrivate *priv;
     gchar buf[32];
     gint sizeOfBuf;
-    gchar *statusString, *fullStatusString, *completedAtString, *comment;
+    gchar *statusString, *fullStatusString, *completedAtString, *comment, 
*markup;
     const gchar *errorStr;
     gint64 eta, uploaded, haveValid, completedAt;
     GtkLabel *keyLabel;
@@ -180,14 +180,16 @@ trg_general_panel_update(TrgGeneralPanel
                        torrent_get_download_dir(t));

     comment = add_links_to_text(torrent_get_comment(t));
-    gtk_label_set_markup(GTK_LABEL(priv->gen_comment_label), comment);
+    markup = g_markup_printf_escaped("%s", comment);
+    gtk_label_set_markup(GTK_LABEL(priv->gen_comment_label), markup);
     g_free(comment);
+    g_free(markup);

     errorStr = torrent_get_errorstr(t);
     keyLabel =
         gen_panel_label_get_key_label(GTK_LABEL(priv->gen_error_label));
     if (strlen(errorStr) > 0) {
-        gchar *markup =
+        markup =
             g_markup_printf_escaped("<span fgcolor=\"red\">%s</span>",
                                     errorStr);
         gtk_label_set_markup(GTK_LABEL(priv->gen_error_label), markup);

Original issue reported on code.google.com by andrey.s...@googlemail.com on 31 Jul 2012 at 5:57

GoogleCodeExporter commented 9 years ago
Thanks for the patch! Committed 8f0476bcded02f5f25a02ef41fe1a9fd13816c05

Original comment by a...@eth0.org.uk on 3 Aug 2012 at 5:38