GNOME Bugzilla – Bug 494598
leave notes with the "<" or "&" character produce empty notes
Last modified: 2008-11-12 17:21:36 UTC
the bug was filed at https://bugs.launchpad.net/ubuntu/+source/gnome-screensaver/+bug/159940 "Entering leave-messages containing a "<" (without quotes) results in an empty leave-message. Example texts (without quotes): "Hey, where are you? >.<" "<RandomNick> RandomChatMessage Please respond to this when you are back!1111" Have checked ">" as well without any problems." libnotify guys don't accept the bug as own, since they argue one should escape the characters before send them: http://trac.galago-project.org/ticket/83
confirming
Created attachment 98720 [details] [review] Escape chars before send them as notification i test this patch, and works fine, but i'm not sure if i'm using the best way to implement this, please take a loot at it.
Thanks for taking a look at this. A few comments on the patch. Since this string is NULL terminated we can use "-1" for the size in the g_markup_escape_text call. Also, since both gtk_text_buffer_get_text [1] and g_markup_escape_text [2] return newly allocated strings we'll have to free both of them. And even though it changes more code I think I'd prefer to continue to use the "text" variable to hold the return value from gtk_text_buffer_get_text and add a new variable called "escaped_text" to hold the return from g_markup_escape_text. Thanks again. [1] http://library.gnome.org/devel/gtk/unstable/GtkTextBuffer.html#gtk-text-buffer-get-text [2] http://library.gnome.org/devel/glib/unstable/glib-Simple-XML-Subset-Parser.html#id3403281
Created attachment 98724 [details] [review] second attempt if i understand correctly, this should be the right way, if not, please tell me so, and i'll try to improve it.
Looks good. I've committed this to svn. Thanks Basilio!
*** Bug 482399 has been marked as a duplicate of this bug. ***
Thanks for the corrections, and pointers
*** Bug 444092 has been marked as a duplicate of this bug. ***