From 41aaca420dfe37a2513c3c340e743d5d1d7c6a04 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Fri, 29 Jun 2007 15:02:14 +0000 Subject: [PATCH] Escape markup entities in the name and URI before displaying them. 2007-06-29 Emmanuele Bassi * gtk/gtkrecentchooserdefault.c (recent_meta_data_func): Escape markup entities in the name and URI before displaying them. svn path=/trunk/; revision=18289 --- ChangeLog | 5 +++++ gtk/gtkrecentchooserdefault.c | 15 ++++++++++----- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3180cd1c2e..71c4708705 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2007-06-29 Emmanuele Bassi + + * gtk/gtkrecentchooserdefault.c (recent_meta_data_func): Escape + markup entities in the name and URI before displaying them. + 2007-06-29 Emmanuele Bassi * gtk/gtkrecentmanager.c (get_icon_for_mime_type): Do not diff --git a/gtk/gtkrecentchooserdefault.c b/gtk/gtkrecentchooserdefault.c index 26a44a0234..c1a3ff7231 100644 --- a/gtk/gtkrecentchooserdefault.c +++ b/gtk/gtkrecentchooserdefault.c @@ -973,8 +973,8 @@ recent_meta_data_func (GtkTreeViewColumn *tree_column, gpointer user_data) { GtkRecentInfo *info = NULL; - gchar *uri, *name; - gchar *str; + gchar *uri, *name, *str; + gchar *escaped_name, *escaped_location; gtk_tree_model_get (model, iter, RECENT_DISPLAY_NAME_COLUMN, &name, @@ -987,12 +987,17 @@ recent_meta_data_func (GtkTreeViewColumn *tree_column, if (!name) name = gtk_recent_info_get_short_name (info); - str = g_strconcat ("", name, "\n", - "", _("Location:"), " ", uri, "", - NULL); + escaped_name = g_markup_printf_escaped ("%s", name); + escaped_location = g_markup_printf_escaped ("%s: %s", + _("Location"), + uri); + str = g_strjoin ("\n", escaped_name, escaped_location, NULL); + g_free (escaped_name); + g_free (escaped_location); g_object_set (cell, "markup", str, NULL); + g_free (str); g_free (uri); g_free (name); gtk_recent_info_unref (info);