# HG changeset patch # User William Pitcock # Date 1241091750 18000 # Node ID 528e08654016a0cd0d071672d8a232f3826bd622 # Parent 85a35e03b0c9815e424ea6a360086fd3a81f423f Backed out changeset 9816407adf4a HTML entities are being encoded twice. diff -r 85a35e03b0c9 -r 528e08654016 src/xspf/xspf.c --- a/src/xspf/xspf.c Thu Apr 30 06:41:19 2009 -0500 +++ b/src/xspf/xspf.c Thu Apr 30 06:42:30 2009 -0500 @@ -313,13 +313,12 @@ } -static void xspf_add_node(xmlDocPtr doc, xmlNodePtr node, TupleValueType type, +static void xspf_add_node(xmlNodePtr node, TupleValueType type, gboolean isMeta, const gchar *xspfName, const gchar *strVal, const gint intVal) { gchar tmps[64]; xmlNodePtr tmp; - xmlChar *encVal; if (isMeta) { tmp = xmlNewNode(NULL, (xmlChar *) "meta"); @@ -329,9 +328,7 @@ switch (type) { case TUPLE_STRING: - encVal = xmlEncodeEntitiesReentrant(doc, (xmlChar *)strVal); - xmlAddChild(tmp, xmlNewText(encVal)); - free(encVal); + xmlAddChild(tmp, xmlNewText((xmlChar *) strVal)); break; case TUPLE_INT: @@ -435,7 +432,7 @@ /* common */ xmlDocSetRootElement(doc, rootnode); - xspf_add_node(doc, rootnode, TUPLE_STRING, FALSE, "creator", PACKAGE "-" VERSION, 0); + xspf_add_node(rootnode, TUPLE_STRING, FALSE, "creator", PACKAGE "-" VERSION, 0); /* add staticlist marker */ if (playlist->attribute & PLAYLIST_STATIC) { @@ -454,7 +451,7 @@ /* save playlist title */ if (playlist->title && playlist->title[0] && g_utf8_validate(playlist->title, -1, NULL)) - xspf_add_node(doc, rootnode, TUPLE_STRING, FALSE, "title", playlist->title, 0); + xspf_add_node(rootnode, TUPLE_STRING, FALSE, "title", playlist->title, 0); tracklist = xmlNewNode(NULL, (xmlChar *)"trackList"); @@ -522,19 +519,19 @@ } if (isOK) - xspf_add_node(doc, track, xs->type, xs->isMeta, xs->xspfName, scratch, scratchi); + xspf_add_node(track, xs->type, xs->isMeta, xs->xspfName, scratch, scratchi); } } else { if (entry->title != NULL && g_utf8_validate(entry->title, -1, NULL)) - xspf_add_node(doc, track, TUPLE_STRING, FALSE, "title", entry->title, 0); + xspf_add_node(track, TUPLE_STRING, FALSE, "title", entry->title, 0); if (entry->length > 0) - xspf_add_node(doc, track, TUPLE_INT, FALSE, "duration", NULL, entry->length); + xspf_add_node(track, TUPLE_INT, FALSE, "duration", NULL, entry->length); /* Add mtime of -1 */ - xspf_add_node(doc, track, TUPLE_INT, TRUE, "mtime", NULL, -1); + xspf_add_node(track, TUPLE_INT, TRUE, "mtime", NULL, -1); } g_free(filename);