From d5ea4ef0e4f4872a03e3ae9f41f23940f99922cc Mon Sep 17 00:00:00 2001 From: Christian Persch Date: Thu, 17 Jun 2004 17:57:12 +0000 Subject: Escape strings before using the with markup in labels. Patch by Crispin 2004-06-17 Christian Persch * embed/mozilla/GtkNSSClientAuthDialogs.cpp: * embed/mozilla/GtkNSSDialogs.cpp: Escape strings before using the with markup in labels. Patch by Crispin Flowerday. --- embed/mozilla/GtkNSSClientAuthDialogs.cpp | 2 +- embed/mozilla/GtkNSSDialogs.cpp | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) (limited to 'embed') diff --git a/embed/mozilla/GtkNSSClientAuthDialogs.cpp b/embed/mozilla/GtkNSSClientAuthDialogs.cpp index 1ff07e953..b3196dd75 100644 --- a/embed/mozilla/GtkNSSClientAuthDialogs.cpp +++ b/embed/mozilla/GtkNSSClientAuthDialogs.cpp @@ -189,7 +189,7 @@ GtkNSSClientAuthDialogs::ChooseCertificate (nsIInterfaceRequestor *ctx, nsEmbedCString utf8_cn; NS_UTF16ToCString (nsEmbedString (cn), NS_CSTRING_ENCODING_UTF8, utf8_cn); - tt_cn = g_strdup_printf ("\"%s\"", utf8_cn.get()); + tt_cn = g_markup_printf_escaped ("\"%s\"", utf8_cn.get()); msg = g_strdup_printf (_("Choose a certificate to present as identification to %s."), tt_cn); diff --git a/embed/mozilla/GtkNSSDialogs.cpp b/embed/mozilla/GtkNSSDialogs.cpp index 1bd1a88e6..ff50a641b 100644 --- a/embed/mozilla/GtkNSSDialogs.cpp +++ b/embed/mozilla/GtkNSSDialogs.cpp @@ -291,10 +291,10 @@ GtkNSSDialogs::ConfirmMismatchDomain (nsIInterfaceRequestor *ctx, NS_UTF16ToCString (commonName, NS_CSTRING_ENCODING_UTF8, cCommonName); - ttTargetUrl = g_strdup_printf ("\"%s\"", - nsEmbedCString(targetURL).get()); + ttTargetUrl = g_markup_printf_escaped ("\"%s\"", + nsEmbedCString(targetURL).get()); - ttCommonName = g_strdup_printf ("\"%s\"", cCommonName.get()); + ttCommonName = g_markup_printf_escaped ("\"%s\"", cCommonName.get()); first = g_strdup_printf (_("The site %s returned security information for " "%s. It is possible that someone is intercepting " @@ -339,7 +339,7 @@ GtkNSSDialogs::ConfirmUnknownIssuer (nsIInterfaceRequestor *ctx, NS_UTF16ToCString (commonName, NS_CSTRING_ENCODING_UTF8, cCommonName); - ttCommonName = g_strdup_printf ("\"%s\"", cCommonName.get()); + ttCommonName = g_markup_printf_escaped ("\"%s\"", cCommonName.get()); secondary = g_strdup_printf (_("Your browser was unable to trust %s. " @@ -446,7 +446,7 @@ GtkNSSDialogs::ConfirmCertExpired (nsIInterfaceRequestor *ctx, localtime_r (&t, &tm)); fdate = g_locale_to_utf8 (formattedDate, -1, NULL, NULL, NULL); - ttCommonName = g_strdup_printf ("\"%s\"", cCommonName.get()); + ttCommonName = g_markup_printf_escaped ("\"%s\"", cCommonName.get()); secondary = g_strdup_printf (text, ttCommonName, fdate); @@ -495,10 +495,10 @@ GtkNSSDialogs::NotifyCrlNextupdate (nsIInterfaceRequestor *ctx, NS_UTF16ToCString (commonName, NS_CSTRING_ENCODING_UTF8, cCommonName); - ttCommonName = g_strdup_printf ("\"%s\"", cCommonName.get()); + ttCommonName = g_markup_printf_escaped ("\"%s\"", cCommonName.get()); - ttTargetUrl = g_strdup_printf ("\"%s\"", - nsEmbedCString(targetURL).get()); + ttTargetUrl = g_markup_printf_escaped ("\"%s\"", + nsEmbedCString(targetURL).get()); primary = g_strdup_printf (_("Cannot establish connection to %s."), ttTargetUrl); @@ -561,7 +561,7 @@ GtkNSSDialogs::ConfirmDownloadCACert(nsIInterfaceRequestor *ctx, NS_UTF16ToCString (commonName, NS_CSTRING_ENCODING_UTF8, cCommonName); - ttCommonName = g_strdup_printf ("\"%s\"", cCommonName.get()); + ttCommonName = g_markup_printf_escaped ("\"%s\"", cCommonName.get()); tertiary = g_strdup_printf (_("Trust %s to identify:"), ttCommonName); g_free (ttCommonName); -- cgit v1.2.3