Package: gtodo
Version: 0.16.0~rc2-1.1
Severity: normal
Tags: patch

The systray popup calls pango_layout_set_markup() to display each todo
item.  That function expects a marked-up text, so any presence of
characters such as "<" or "&" may screw up the display unless they are
escaped.


-- System Information:
Debian Release: squeeze/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: i386 (i686)

Kernel: Linux 2.6.26.8 (SMP w/1 CPU core)
Locale: LANG=en_CA.UTF-8, LC_CTYPE=en_CA.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages gtodo depends on:
ii  gconf2                   2.26.2-3        GNOME configuration database syste
ii  libatk1.0-0              1.26.0-1        The ATK accessibility toolkit
ii  libc6                    2.9-24          GNU C Library: Shared libraries
ii  libcairo2                1.8.8-2         The Cairo 2D vector graphics libra
ii  libgconf2-4              2.26.2-3        GNOME configuration database syste
ii  libglib2.0-0             2.20.4-1        The GLib library of C routines
ii  libgnomevfs2-0           1:2.24.1-4      GNOME Virtual File System (runtime
ii  libgtk2.0-0              2.16.5-1        The GTK+ graphical user interface 
ii  libpango1.0-0            1.24.5-1        Layout and rendering of internatio
ii  libx11-6                 2:1.2.2-1       X11 client-side library
ii  libxml2                  2.7.3.dfsg-2+b1 GNOME XML library
ii  libxslt1.1               1.1.24-2        XSLT processing library - runtime 

gtodo recommends no packages.

Versions of packages gtodo suggests:
pn  gtodo-applet                  <none>     (no description available)

-- no debconf information
commit 7b06721e93d4cdca831f6aa02b16df29d864a883
Author: Frédéric Brière <[email protected]>
Date:   Fri Aug 14 11:48:10 2009 -0400

    Escape todo items before adding them to the systray popup
    
    The systray popup calls pango_layout_set_markup() to display each todo
    item.  That function expects a marked-up text, so any presence of
    characters such as "<" or "&" may screw up the display unless they are
    escaped.

diff --git a/src/tray-icon.c b/src/tray-icon.c
index 360b878..95c0409 100644
--- a/src/tray-icon.c
+++ b/src/tray-icon.c
@@ -47,7 +47,8 @@ void tray_paint_tip(GtkWidget *widget, GdkEventExpose *event)
                        gchar *string = NULL;
                        GTodoItem *item = 
gtodo_client_get_todo_item_from_list(list); 
 
-                       string = gtodo_todo_item_get_summary(item);     
+                       string = g_markup_printf_escaped("%s",
+                                       gtodo_todo_item_get_summary(item));
 
                        pango_layout_set_markup(tray_layout_tooltip, string, 
-1);
                        pango_layout_get_size(tray_layout_tooltip, &m_width, 
&m_height);
@@ -64,6 +65,8 @@ void tray_paint_tip(GtkWidget *widget, GdkEventExpose *event)
                                height = height + PANGO_PIXELS(m_height);
                        }
 
+                       g_free(string);
+
                }while(gtodo_client_get_list_next(list));
                gtodo_client_free_todo_item_list(cl, list);
        }
@@ -111,7 +114,8 @@ gboolean tray_motion_cb (GtkWidget *tv, GdkEventCrossing 
*event, gpointer n)
                        gchar *string = NULL;
                        GTodoItem *item = 
gtodo_client_get_todo_item_from_list(list); 
 
-                       string = gtodo_todo_item_get_summary(item);     
+                       string = g_markup_printf_escaped("%s",
+                                       gtodo_todo_item_get_summary(item));
 
                        pango_layout_set_markup(tray_layout_tooltip, string,-1);
                        pango_layout_get_size(tray_layout_tooltip, &m_width, 
&m_height);
@@ -122,6 +126,8 @@ gboolean tray_motion_cb (GtkWidget *tv, GdkEventCrossing 
*event, gpointer n)
                                height = height + m_height;
                        }
 
+                       g_free(string);
+
                }while(gtodo_client_get_list_next(list));
                gtodo_client_free_todo_item_list(cl, list);
        }

Reply via email to