[gnome-color-manager] Show the correct copyright notice when a profile has used markup in the description



commit 23b22fe9ea9b3d2dd98211636ea33cd9bf543677
Author: Richard Hughes <richard hughsie com>
Date:   Wed Sep 22 15:10:47 2010 +0100

    Show the correct copyright notice when a profile has used markup in the description

 src/gcm-utils.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/src/gcm-utils.c b/src/gcm-utils.c
index ee89a00..8becc55 100644
--- a/src/gcm-utils.c
+++ b/src/gcm-utils.c
@@ -38,12 +38,17 @@
  * gcm_utils_linkify:
  **/
 gchar *
-gcm_utils_linkify (const gchar *text)
+gcm_utils_linkify (const gchar *hostile_text)
 {
 	guint i;
 	guint j = 0;
 	gboolean ret;
 	GString *string;
+	gchar *text;
+
+	/* Properly escape this as some profiles 'helpfully' put markup in like:
+	 * "Copyright (C) 2005-2010 Kai-Uwe Behrmann <www.behrmann.name>" */
+	text = g_markup_escape_text (hostile_text, -1);
 
 	/* find and replace links */
 	string = g_string_new ("");
@@ -73,6 +78,7 @@ gcm_utils_linkify (const gchar *text)
 			break;
 		}
 	}
+	g_free (text);
 	return g_string_free (string, FALSE);
 }
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]