After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 494598 - leave notes with the "<" or "&" character produce empty notes
leave notes with the "<" or "&" character produce empty notes
Status: RESOLVED FIXED
Product: gnome-screensaver
Classification: Deprecated
Component: general
2.20.x
Other Linux
: Normal normal
: ---
Assigned To: gnome-screensaver maintainers
gnome-screensaver maintainers
: 444092 482399 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2007-11-07 14:00 UTC by Basilio Kublik
Modified: 2008-11-12 17:21 UTC
See Also:
GNOME target: ---
GNOME version: 2.19/2.20


Attachments
Escape chars before send them as notification (1.00 KB, patch)
2007-11-07 14:34 UTC, Basilio Kublik
needs-work Details | Review
second attempt (1.29 KB, patch)
2007-11-07 16:09 UTC, Basilio Kublik
committed Details | Review

Description Basilio Kublik 2007-11-07 14:00:44 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
Comment 1 Pedro Villavicencio 2007-11-07 14:02:54 UTC
confirming
Comment 2 Basilio Kublik 2007-11-07 14:34:59 UTC
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.
Comment 3 William Jon McCann 2007-11-07 15:20:58 UTC
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
Comment 4 Basilio Kublik 2007-11-07 16:09:27 UTC
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.
Comment 5 William Jon McCann 2007-11-09 21:47:37 UTC
Looks good.  I've committed this to svn.  Thanks Basilio!
Comment 6 William Jon McCann 2007-11-09 21:49:53 UTC
*** Bug 482399 has been marked as a duplicate of this bug. ***
Comment 7 Basilio Kublik 2007-11-10 00:03:16 UTC
Thanks for the corrections, and pointers
Comment 8 William Jon McCann 2008-11-12 17:21:36 UTC
*** Bug 444092 has been marked as a duplicate of this bug. ***