]> git.0d.be Git - empathy.git/commitdiff
Disable empathy_add_link_markup() if linked to an old GTK version
authorXavier Claessens <xclaesse@gmail.com>
Wed, 10 Mar 2010 10:41:29 +0000 (11:41 +0100)
committerXavier Claessens <xclaesse@gmail.com>
Wed, 10 Mar 2010 11:04:57 +0000 (12:04 +0100)
Using links in labels could make a freeze, see GNOME #612066

libempathy-gtk/empathy-string-parser.c

index 5c3fb197294771af86ae8b34351c8791876577a5..691263a9904dc87535f8f04aaff4de5302668587 100644 (file)
@@ -203,6 +203,14 @@ empathy_add_link_markup (const gchar *text)
 
        g_return_val_if_fail (text != NULL, NULL);
 
 
        g_return_val_if_fail (text != NULL, NULL);
 
+       /* GtkLabel with links could make infinite loop because of
+        * GNOME bug #612066. It is fixed in GTK >= 2.18.8 and GTK >= 2.19.7.
+        * FIXME: Remove this check once we have an hard dep on GTK 2.20 */
+       if (!gtk_check_version (2, 18, 8) ||
+           (gtk_minor_version == 19 && gtk_micro_version < 7)) {
+               return g_markup_escape_text (text, -1);
+       }
+
        string = g_string_sized_new (strlen (text));
        empathy_string_parser_substr (text, -1, parsers, string);
 
        string = g_string_sized_new (strlen (text));
        empathy_string_parser_substr (text, -1, parsers, string);