<div dir="ltr">Hi Simon!<div><br></div><div>Sorry for the delay. The patch works as expected and has been pushed here:</div><div><br></div><div><a href="https://git.xfce.org/apps/parole/commit/?id=eb0609e9b96fe8ffdb8e40679d2353e26a5a079b">https://git.xfce.org/apps/parole/commit/?id=eb0609e9b96fe8ffdb8e40679d2353e26a5a079b</a><br></div><div><br></div><div>Thanks!</div><div>Sean</div></div><br><div class="gmail_quote"><div dir="ltr">On Sun, Apr 9, 2017 at 10:22 PM Simon Marchi <<a href="mailto:simon.marchi@polymtl.ca">simon.marchi@polymtl.ca</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 2017-03-26 16:27, Simon Marchi wrote:<br class="gmail_msg">
> When playing a file with an ampersand in it, I noticed this kind of<br class="gmail_msg">
> warnings:<br class="gmail_msg">
><br class="gmail_msg">
> (parole:16594): Gtk-WARNING **: Failed to set text '<span<br class="gmail_msg">
> color='#F4F4F4'><b><big>test & test.mp3</big></b></span>' from markup<br class="gmail_msg">
> due to error parsing markup: Error on line 1: Entity did not end with<br class="gmail_msg">
> a semicolon; most likely you used an ampersand character without<br class="gmail_msg">
> intending to start an entity - escape ampersand as &<br class="gmail_msg">
><br class="gmail_msg">
> And indeed, the function parole_player_media_tag_cb fails to escape the<br class="gmail_msg">
> filename. I changed the calls to g_strdup_printf to<br class="gmail_msg">
> g_markup_printf_escaped. The warnings have disappeared, and the<br class="gmail_msg">
> audiobox now shows the filename whereas it would show "Unknown song"<br class="gmail_msg">
> before.<br class="gmail_msg">
> ---<br class="gmail_msg">
> src/parole-player.c | 8 ++++----<br class="gmail_msg">
> 1 file changed, 4 insertions(+), 4 deletions(-)<br class="gmail_msg">
><br class="gmail_msg">
> diff --git a/src/parole-player.c b/src/parole-player.c<br class="gmail_msg">
> index 6baddb3..3b39974 100644<br class="gmail_msg">
> --- a/src/parole-player.c<br class="gmail_msg">
> +++ b/src/parole-player.c<br class="gmail_msg">
> @@ -1912,13 +1912,13 @@ parole_player_media_tag_cb (ParoleGst *gst,<br class="gmail_msg">
> const ParoleStream *stream, ParolePl<br class="gmail_msg">
> if ( filename )<br class="gmail_msg">
> {<br class="gmail_msg">
> gtk_window_set_title (GTK_WINDOW<br class="gmail_msg">
> (player->priv->window), filename);<br class="gmail_msg">
> -<br class="gmail_msg">
> gtk_label_set_markup(GTK_LABEL(player->priv->audiobox_title),<br class="gmail_msg">
> g_strdup_printf("<span color='#F4F4F4'><b><big>%s</big></b></span>",<br class="gmail_msg">
> filename));<br class="gmail_msg">
> +<br class="gmail_msg">
> gtk_label_set_markup(GTK_LABEL(player->priv->audiobox_title),<br class="gmail_msg">
> g_markup_printf_escaped("<span<br class="gmail_msg">
> color='#F4F4F4'><b><big>%s</big></b></span>", filename));<br class="gmail_msg">
> g_free (filename);<br class="gmail_msg">
> }<br class="gmail_msg">
> else<br class="gmail_msg">
> {<br class="gmail_msg">
> gtk_window_set_title (GTK_WINDOW<br class="gmail_msg">
> (player->priv->window), _("Parole Media Player"));<br class="gmail_msg">
> -<br class="gmail_msg">
> gtk_label_set_markup(GTK_LABEL(player->priv->audiobox_title),<br class="gmail_msg">
> g_strdup_printf("<span color='#F4F4F4'><b><big>%s</big></b></span>",<br class="gmail_msg">
> _("Unknown Song")));<br class="gmail_msg">
> +<br class="gmail_msg">
> gtk_label_set_markup(GTK_LABEL(player->priv->audiobox_title),<br class="gmail_msg">
> g_markup_printf_escaped("<span<br class="gmail_msg">
> color='#F4F4F4'><b><big>%s</big></b></span>", _("Unknown Song")));<br class="gmail_msg">
> }<br class="gmail_msg">
> }<br class="gmail_msg">
> g_free(uri);<br class="gmail_msg">
> @@ -1934,7 +1934,7 @@ parole_player_media_tag_cb (ParoleGst *gst,<br class="gmail_msg">
> const ParoleStream *stream, ParolePl<br class="gmail_msg">
> }<br class="gmail_msg">
><br class="gmail_msg">
> else<br class="gmail_msg">
> -<br class="gmail_msg">
> gtk_label_set_markup(GTK_LABEL(player->priv->audiobox_album),<br class="gmail_msg">
> g_strdup_printf("<big><span color='#BBBBBB'><i>%s</i></span> <span<br class="gmail_msg">
> color='#F4F4F4'>%s</span></big>", _("on"), _("Unknown Album")));<br class="gmail_msg">
> +<br class="gmail_msg">
> gtk_label_set_markup(GTK_LABEL(player->priv->audiobox_album),<br class="gmail_msg">
> g_markup_printf_escaped("<big><span color='#BBBBBB'><i>%s</i></span><br class="gmail_msg">
> <span color='#F4F4F4'>%s</span></big>", _("on"), _("Unknown Album")));<br class="gmail_msg">
><br class="gmail_msg">
> if (year)<br class="gmail_msg">
> g_free (year);<br class="gmail_msg">
> @@ -1945,7 +1945,7 @@ parole_player_media_tag_cb (ParoleGst *gst,<br class="gmail_msg">
> const ParoleStream *stream, ParolePl<br class="gmail_msg">
> g_free (artist);<br class="gmail_msg">
> }<br class="gmail_msg">
> else<br class="gmail_msg">
> -<br class="gmail_msg">
> gtk_label_set_markup(GTK_LABEL(player->priv->audiobox_artist),<br class="gmail_msg">
> g_strdup_printf("<big><span color='#BBBBBB'><i>%s</i></span> <span<br class="gmail_msg">
> color='#F4F4F4'>%s</span></big>", _("by"), _("Unknown Artist")));<br class="gmail_msg">
> +<br class="gmail_msg">
> gtk_label_set_markup(GTK_LABEL(player->priv->audiobox_artist),<br class="gmail_msg">
> g_markup_printf_escaped("<big><span color='#BBBBBB'><i>%s</i></span><br class="gmail_msg">
> <span color='#F4F4F4'>%s</span></big>", _("by"), _("Unknown<br class="gmail_msg">
> Artist")));<br class="gmail_msg">
><br class="gmail_msg">
> image = parole_stream_get_image(G_OBJECT(stream));<br class="gmail_msg">
> if (image)<br class="gmail_msg">
<br class="gmail_msg">
Ping.<br class="gmail_msg">
_______________________________________________<br class="gmail_msg">
Xfce4-dev mailing list<br class="gmail_msg">
<a href="mailto:Xfce4-dev@xfce.org" class="gmail_msg" target="_blank">Xfce4-dev@xfce.org</a><br class="gmail_msg">
<a href="https://mail.xfce.org/mailman/listinfo/xfce4-dev" rel="noreferrer" class="gmail_msg" target="_blank">https://mail.xfce.org/mailman/listinfo/xfce4-dev</a></blockquote></div>