[sushi] audio: escape tags content before setting markup



commit 700ef23c4cbcff57f18157dd54acb80356edf30a
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Wed Jun 19 15:10:50 2019 -0700

    audio: escape tags content before setting markup
    
    The contents may contain markup characters themselves, so let's
    escape them first.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=700589

 src/viewers/audio.js | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)
---
diff --git a/src/viewers/audio.js b/src/viewers/audio.js
index 079820d..ef0534f 100644
--- a/src/viewers/audio.js
+++ b/src/viewers/audio.js
@@ -338,12 +338,18 @@ var Klass = GObject.registerClass({
             titleName = file.get_basename();
         }
 
-        if (albumName)
-            this._albumLabel.set_markup('<small><i>' + _("from") + '  </i>' + albumName + '</small>');
-        if (artistName)
-            this._authorLabel.set_markup('<small><i>' + _("by") + '  </i><b>' + artistName + '</b></small>');
+        if (albumName) {
+            let escaped = GLib.markup_escape_text(albumName, -1);
+            this._albumLabel.set_markup('<small><i>' + _("from") + '  </i>' + escaped + '</small>');
+        }
+
+        if (artistName) {
+            let escaped = GLib.markup_escape_text(artistName, -1);
+            this._authorLabel.set_markup('<small><i>' + _("by") + '  </i><b>' + escaped + '</b></small>');
+        }
 
-        this._titleLabel.set_markup('<b>' + titleName + '</b>');
+        let escaped = GLib.markup_escape_text(titleName, -1);
+        this._titleLabel.set_markup('<b>' + escaped + '</b>');
 
         if (artistName && albumName && !this._coverFetched) {
             fetchCoverArt(tags, this._onCoverArtFetched.bind(this));


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]