summaryrefslogtreecommitdiff
path: root/plugins/notify
diff options
context:
space:
mode:
authorGravatar Alexey Yakovenko <wakeroid@gmail.com>2010-04-19 20:43:52 +0200
committerGravatar Alexey Yakovenko <wakeroid@gmail.com>2010-04-19 20:43:52 +0200
commitca1e12ca501be4054a9a608509ec744a70b32500 (patch)
tree08704814e1aba3f7c6ee6787e00f8d1bbb9d002c /plugins/notify
parentd10d940aa6a9c361c61d81ed378b46b8afb17198 (diff)
added escaping of more XML special chars in notify plugin
Diffstat (limited to 'plugins/notify')
-rw-r--r--plugins/notify/notify.c36
1 files changed, 33 insertions, 3 deletions
diff --git a/plugins/notify/notify.c b/plugins/notify/notify.c
index 866460be..e6c8e4b1 100644
--- a/plugins/notify/notify.c
+++ b/plugins/notify/notify.c
@@ -84,6 +84,38 @@ on_songchanged (DB_event_trackchange_t *ev, uintptr_t data) {
dst += 5;
src++;
}
+ else if (*src == '<') {
+ if (end - dst < 4) {
+ break;
+ }
+ strcpy (dst, "&lt;");
+ dst += 4;
+ src++;
+ }
+ else if (*src == '>') {
+ if (end - dst < 4) {
+ break;
+ }
+ strcpy (dst, "&gt;");
+ dst += 4;
+ src++;
+ }
+ else if (*src == '\'') {
+ if (end - dst < 6) {
+ break;
+ }
+ strcpy (dst, "&apos;");
+ dst += 6;
+ src++;
+ }
+ else if (*src == '"') {
+ if (end - dst < 6) {
+ break;
+ }
+ strcpy (dst, "&quot;");
+ dst += 6;
+ src++;
+ }
else {
*dst++ = *src++;
}
@@ -128,10 +160,8 @@ on_songchanged (DB_event_trackchange_t *ev, uintptr_t data) {
int serial;
dbus_bool_t retval = dbus_connection_send(conn,msg,&serial);
- printf ("retval: %d\n", retval);
- //dbus_message_unref (msg);
dbus_connection_flush (conn);
-
+ dbus_message_unref (msg);
}
}
return 0;