summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkajzer <[email protected]>2016-08-27 21:25:10 +0200
committerkajzer <[email protected]>2016-08-27 21:58:17 +0200
commitf95d699d693d3781a15c90a04bc63ad62897eb48 (patch)
treed7870e7e8cfddba82557399a3d4058cd24075bc1
parentda0b7c16ee5cfaa0a3fa5e913e39b0c8b539e1bf (diff)
downloadmate-notification-daemon-f95d699d693d3781a15c90a04bc63ad62897eb48.tar.bz2
mate-notification-daemon-f95d699d693d3781a15c90a04bc63ad62897eb48.tar.xz
Fix: escape text #106
-rw-r--r--src/themes/coco/coco-theme.c9
-rw-r--r--src/themes/nodoka/nodoka-theme.c9
-rw-r--r--src/themes/slider/theme.c4
-rw-r--r--src/themes/standard/theme.c4
4 files changed, 20 insertions, 6 deletions
diff --git a/src/themes/coco/coco-theme.c b/src/themes/coco/coco-theme.c
index a3c54bd..ca742b4 100644
--- a/src/themes/coco/coco-theme.c
+++ b/src/themes/coco/coco-theme.c
@@ -495,16 +495,21 @@ void
set_notification_text(GtkWindow *nw, const char *summary, const char *body)
{
char *str;
+ char* quoted;
WindowData *windata = g_object_get_data(G_OBJECT(nw), "windata");
g_assert(windata != NULL);
+ quoted = g_markup_escape_text(summary, -1);
str = g_strdup_printf(
- "<span color=\"#FFFFFF\"><big><b>%s</b></big></span>", summary);
+ "<span color=\"#FFFFFF\"><big><b>%s</b></big></span>", quoted);
+ g_free(quoted);
gtk_label_set_markup(GTK_LABEL(windata->summary_label), str);
g_free(str);
+ quoted = g_markup_escape_text(body, -1);
str = g_strdup_printf(
- "<span color=\"#EAEAEA\">%s</span>", body);
+ "<span color=\"#EAEAEA\">%s</span>", quoted);
+ g_free(quoted);
gtk_label_set_markup (GTK_LABEL (windata->body_label), str);
g_free(str);
diff --git a/src/themes/nodoka/nodoka-theme.c b/src/themes/nodoka/nodoka-theme.c
index 318291c..628a415 100644
--- a/src/themes/nodoka/nodoka-theme.c
+++ b/src/themes/nodoka/nodoka-theme.c
@@ -880,16 +880,21 @@ void
set_notification_text(GtkWindow *nw, const char *summary, const char *body)
{
char *str;
+ char* quoted;
WindowData *windata = g_object_get_data(G_OBJECT(nw), "windata");
g_assert(windata != NULL);
+ quoted = g_markup_escape_text(summary, -1);
str = g_strdup_printf(
- "<span color=\"#000000\"><b><big>%s</big></b></span>", summary);
+ "<span color=\"#000000\"><b><big>%s</big></b></span>", quoted);
+ g_free(quoted);
gtk_label_set_markup(GTK_LABEL(windata->summary_label), str);
g_free(str);
+ quoted = g_markup_escape_text(body, -1);
str = g_strdup_printf(
- "<span color=\"#000000\">%s</span>", body);
+ "<span color=\"#000000\">%s</span>", quoted);
+ g_free(quoted);
gtk_label_set_markup(GTK_LABEL(windata->body_label), str);
g_free(str);
diff --git a/src/themes/slider/theme.c b/src/themes/slider/theme.c
index 5fecb71..86440b0 100644
--- a/src/themes/slider/theme.c
+++ b/src/themes/slider/theme.c
@@ -513,7 +513,9 @@ void set_notification_text(GtkWindow* nw, const char* summary, const char* body)
gtk_label_set_markup(GTK_LABEL(windata->summary_label), str);
g_free(str);
- gtk_label_set_markup(GTK_LABEL(windata->body_label), body);
+ quoted = g_markup_escape_text(body, -1);
+ gtk_label_set_markup(GTK_LABEL(windata->body_label), quoted);
+ g_free(quoted);
if (body == NULL || *body == '\0')
{
diff --git a/src/themes/standard/theme.c b/src/themes/standard/theme.c
index 990facc..ba44fcd 100644
--- a/src/themes/standard/theme.c
+++ b/src/themes/standard/theme.c
@@ -857,7 +857,9 @@ void set_notification_text(GtkWindow* nw, const char* summary, const char* body)
gtk_label_set_markup(GTK_LABEL(windata->summary_label), str);
g_free(str);
- gtk_label_set_markup(GTK_LABEL(windata->body_label), body);
+ quoted = g_markup_escape_text(body, -1);
+ gtk_label_set_markup(GTK_LABEL(windata->body_label), quoted);
+ g_free(quoted);
if (body == NULL || *body == '\0')
{