[PATCH parole] Add missing escaping in audiobox
Sean Davis
smd.seandavis at gmail.com
Tue Apr 11 11:09:37 CEST 2017
Hi Simon!
Sorry for the delay. The patch works as expected and has been pushed here:
https://git.xfce.org/apps/parole/commit/?id=eb0609e9b96fe8ffdb8e40679d2353e26a5a079b
Thanks!
Sean
On Sun, Apr 9, 2017 at 10:22 PM Simon Marchi <simon.marchi at polymtl.ca>
wrote:
> On 2017-03-26 16:27, Simon Marchi wrote:
> > When playing a file with an ampersand in it, I noticed this kind of
> > warnings:
> >
> > (parole:16594): Gtk-WARNING **: Failed to set text '<span
> > color='#F4F4F4'><b><big>test & test.mp3</big></b></span>' from markup
> > due to error parsing markup: Error on line 1: Entity did not end with
> > a semicolon; most likely you used an ampersand character without
> > intending to start an entity - escape ampersand as &
> >
> > And indeed, the function parole_player_media_tag_cb fails to escape the
> > filename. I changed the calls to g_strdup_printf to
> > g_markup_printf_escaped. The warnings have disappeared, and the
> > audiobox now shows the filename whereas it would show "Unknown song"
> > before.
> > ---
> > src/parole-player.c | 8 ++++----
> > 1 file changed, 4 insertions(+), 4 deletions(-)
> >
> > diff --git a/src/parole-player.c b/src/parole-player.c
> > index 6baddb3..3b39974 100644
> > --- a/src/parole-player.c
> > +++ b/src/parole-player.c
> > @@ -1912,13 +1912,13 @@ parole_player_media_tag_cb (ParoleGst *gst,
> > const ParoleStream *stream, ParolePl
> > if ( filename )
> > {
> > gtk_window_set_title (GTK_WINDOW
> > (player->priv->window), filename);
> > -
> > gtk_label_set_markup(GTK_LABEL(player->priv->audiobox_title),
> > g_strdup_printf("<span color='#F4F4F4'><b><big>%s</big></b></span>",
> > filename));
> > +
> > gtk_label_set_markup(GTK_LABEL(player->priv->audiobox_title),
> > g_markup_printf_escaped("<span
> > color='#F4F4F4'><b><big>%s</big></b></span>", filename));
> > g_free (filename);
> > }
> > else
> > {
> > gtk_window_set_title (GTK_WINDOW
> > (player->priv->window), _("Parole Media Player"));
> > -
> > gtk_label_set_markup(GTK_LABEL(player->priv->audiobox_title),
> > g_strdup_printf("<span color='#F4F4F4'><b><big>%s</big></b></span>",
> > _("Unknown Song")));
> > +
> > gtk_label_set_markup(GTK_LABEL(player->priv->audiobox_title),
> > g_markup_printf_escaped("<span
> > color='#F4F4F4'><b><big>%s</big></b></span>", _("Unknown Song")));
> > }
> > }
> > g_free(uri);
> > @@ -1934,7 +1934,7 @@ parole_player_media_tag_cb (ParoleGst *gst,
> > const ParoleStream *stream, ParolePl
> > }
> >
> > else
> > -
> > gtk_label_set_markup(GTK_LABEL(player->priv->audiobox_album),
> > g_strdup_printf("<big><span color='#BBBBBB'><i>%s</i></span> <span
> > color='#F4F4F4'>%s</span></big>", _("on"), _("Unknown Album")));
> > +
> > gtk_label_set_markup(GTK_LABEL(player->priv->audiobox_album),
> > g_markup_printf_escaped("<big><span color='#BBBBBB'><i>%s</i></span>
> > <span color='#F4F4F4'>%s</span></big>", _("on"), _("Unknown Album")));
> >
> > if (year)
> > g_free (year);
> > @@ -1945,7 +1945,7 @@ parole_player_media_tag_cb (ParoleGst *gst,
> > const ParoleStream *stream, ParolePl
> > g_free (artist);
> > }
> > else
> > -
> > gtk_label_set_markup(GTK_LABEL(player->priv->audiobox_artist),
> > g_strdup_printf("<big><span color='#BBBBBB'><i>%s</i></span> <span
> > color='#F4F4F4'>%s</span></big>", _("by"), _("Unknown Artist")));
> > +
> > gtk_label_set_markup(GTK_LABEL(player->priv->audiobox_artist),
> > g_markup_printf_escaped("<big><span color='#BBBBBB'><i>%s</i></span>
> > <span color='#F4F4F4'>%s</span></big>", _("by"), _("Unknown
> > Artist")));
> >
> > image = parole_stream_get_image(G_OBJECT(stream));
> > if (image)
>
> Ping.
> _______________________________________________
> Xfce4-dev mailing list
> Xfce4-dev at xfce.org
> https://mail.xfce.org/mailman/listinfo/xfce4-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.xfce.org/pipermail/xfce4-dev/attachments/20170411/3332e92e/attachment.html>
More information about the Xfce4-dev
mailing list