changeset 3090:528e08654016

Backed out changeset 9816407adf4a HTML entities are being encoded twice.
author William Pitcock <nenolod@atheme.org>
date Thu, 30 Apr 2009 06:42:30 -0500
parents 85a35e03b0c9
children 2bd8895c9fe0
files src/xspf/xspf.c
diffstat 1 files changed, 8 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- 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);