[gtk+] shortcuts window: Fix handling of significant xml chars



commit 1c6b878e090666898acd16664851d82067fb5c9e
Author: Matthias Clasen <mclasen redhat com>
Date:   Sun Jun 19 17:49:03 2016 -0400

    shortcuts window: Fix handling of significant xml chars
    
    We are using markup in the labels, so we need to escape things
    like < and >.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=767795

 gtk/gtkshortcutlabel.c |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtkshortcutlabel.c b/gtk/gtkshortcutlabel.c
index a62641a..06b1736 100644
--- a/gtk/gtkshortcutlabel.c
+++ b/gtk/gtkshortcutlabel.c
@@ -150,6 +150,21 @@ get_labels (guint key, GdkModifierType modifier, guint *n_mods)
     {
       switch (ch)
         {
+        case '<':
+          labels[i++] = "&lt;";
+          break;
+        case '>':
+          labels[i++] = "&gt;";
+          break;
+        case '&':
+          labels[i++] = "&amp;";
+          break;
+        case '"':
+          labels[i++] = "&quot;";
+          break;
+        case '\'':
+          labels[i++] = "&apos;";
+          break;
         case '\\':
           labels[i++] = C_("keyboard label", "Backslash");
           break;


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