From 21f056e8c51e0c1f9ad522a41b5cfd48ea088160 Mon Sep 17 00:00:00 2001 From: Daniel Tisza Date: Sun, 11 Jul 2010 11:52:23 +0300 Subject: [PATCH] Add entity encoding for input options when outputting an xml file. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Entity encoding was missing (for options) in generation of an xspf playlist. On the reading side the entity decoding is all fine. Signed-off-by: Rémi Denis-Courmont --- modules/misc/playlist/xspf.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/modules/misc/playlist/xspf.c b/modules/misc/playlist/xspf.c index 3db0e98442..4f09caf969 100644 --- a/modules/misc/playlist/xspf.c +++ b/modules/misc/playlist/xspf.c @@ -208,10 +208,18 @@ xspfexportitem_end: for( int i = 0; i < p_item->p_input->i_options; i++ ) { - fprintf( p_file, "\t\t\t\t%s\n", - p_item->p_input->ppsz_options[i][0] == ':' ? - p_item->p_input->ppsz_options[i] + 1 : - p_item->p_input->ppsz_options[i] ); + char* psz_src = p_item->p_input->ppsz_options[i]; + char* psz_ret = NULL; + + if ( psz_src[0] == ':' ) + psz_src++; + + psz_ret = convert_xml_special_chars( psz_src ); + if ( psz_ret == NULL ) + continue; + + fprintf( p_file, "\t\t\t\t%s\n", psz_ret ); + free( psz_ret ); } fputs( "\t\t\t\n", p_file ); fputs( "\t\t\n", p_file ); -- 2.39.2