From 659fea07eeeb4854f3273e37779e0cc81c7f299b Mon Sep 17 00:00:00 2001 From: chayleaf Date: Thu, 6 Apr 2023 13:17:43 +0700 Subject: [PATCH] mpris: fix non-dynamic tags not being html escaped --- src/modules/mpris/mpris.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/modules/mpris/mpris.cpp b/src/modules/mpris/mpris.cpp index e6fedff..e89b8ef 100644 --- a/src/modules/mpris/mpris.cpp +++ b/src/modules/mpris/mpris.cpp @@ -619,9 +619,12 @@ auto Mpris::update() -> void { try { auto label_format = fmt::format( - fmt::runtime(formatstr), fmt::arg("player", info.name), - fmt::arg("status", info.status_string), fmt::arg("artist", getArtistStr(info, true)), - fmt::arg("title", getTitleStr(info, true)), fmt::arg("album", getAlbumStr(info, true)), + fmt::runtime(formatstr), + fmt::arg("player", std::string(Glib::Markup::escape_text(info.name))), + fmt::arg("status", info.status_string), + fmt::arg("artist", std::string(Glib::Markup::escape_text(getArtistStr(info, true)))), + fmt::arg("title", std::string(Glib::Markup::escape_text(getTitleStr(info, true)))), + fmt::arg("album", std::string(Glib::Markup::escape_text(getAlbumStr(info, true)))), fmt::arg("length", length), fmt::arg("position", position), fmt::arg("dynamic", getDynamicStr(info, true, true)), fmt::arg("player_icon", getIconFromJson(config_["player-icons"], info.name)),