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



commit dec9b7e152f360bcd648636c21f1d4d9250e4e2a
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 410c0b8..9f02a5a 100644
--- a/src/gcm-utils.c
+++ b/src/gcm-utils.c
@@ -34,12 +34,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 ("");
@@ -69,6 +74,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]