diff --git a/NEWS b/NEWS index 7cf1248d3..9a0ecc0c5 100644 --- a/NEWS +++ b/NEWS @@ -2,7 +2,7 @@ ver 0.21.21 (not yet released) * configuration - fix bug in "metadata_to_use" setting * playlist - - xspf: fix corrupt tags in the presence of XML entities + - asx, xspf: fix corrupt tags in the presence of XML entities * archive - iso9660: skip empty file names to work around libcdio bug * decoder diff --git a/src/playlist/plugins/AsxPlaylistPlugin.cxx b/src/playlist/plugins/AsxPlaylistPlugin.cxx index daaaa18dd..ec365fe36 100644 --- a/src/playlist/plugins/AsxPlaylistPlugin.cxx +++ b/src/playlist/plugins/AsxPlaylistPlugin.cxx @@ -59,6 +59,8 @@ struct AsxParser { TagBuilder tag_builder; + std::string value; + AsxParser() :state(ROOT) {} @@ -77,6 +79,7 @@ asx_start_element(void *user_data, const XML_Char *element_name, const XML_Char **atts) { AsxParser *parser = (AsxParser *)user_data; + parser->value.clear(); switch (parser->state) { case AsxParser::ROOT: @@ -128,9 +131,15 @@ asx_end_element(void *user_data, const XML_Char *element_name) break; case AsxParser::TAG: + if (!parser->value.empty()) + parser->tag_builder.AddItem(parser->tag_type, + StringView(parser->value.data(), + parser->value.length())); parser->state = AsxParser::ENTRY; break; } + + parser->value.clear(); } static void XMLCALL @@ -144,8 +153,7 @@ asx_char_data(void *user_data, const XML_Char *s, int len) break; case AsxParser::TAG: - parser->tag_builder.AddItem(parser->tag_type, - StringView(s, len)); + parser->value.append(s, len); break; } }