[Xfce4-commits] <midori:master> Catch failure to unescape Uris and don't escape ' ' or '+'
Christian Dywan
noreply at xfce.org
Sat Nov 21 02:40:02 CET 2009
Updating branch refs/heads/master
to 7bfd4e147d3b5ac64e588b580760b0909ffbc9cf (commit)
from 34e02640cfb580fed68c22d0d9f8d4b23eb30649 (commit)
commit 7bfd4e147d3b5ac64e588b580760b0909ffbc9cf
Author: Christian Dywan <christian at twotoasts.de>
Date: Fri Nov 20 20:33:51 2009 +0100
Catch failure to unescape Uris and don't escape ' ' or '+'
midori/sokoke.c | 16 +++++++++++++---
1 files changed, 13 insertions(+), 3 deletions(-)
diff --git a/midori/sokoke.c b/midori/sokoke.c
index 17993b8..7364f94 100644
--- a/midori/sokoke.c
+++ b/midori/sokoke.c
@@ -458,11 +458,17 @@ sokoke_format_uri_for_display (const gchar* uri)
{
if (uri && g_str_has_prefix (uri, "http://"))
{
- gchar* unescaped = g_uri_unescape_string (uri, NULL);
+ gchar* unescaped = g_uri_unescape_string (uri, " +");
#ifdef HAVE_LIBSOUP_2_27_90
gchar* path;
- gchar* hostname = sokoke_hostname_from_uri (unescaped, &path);
- gchar* decoded = g_hostname_to_unicode (hostname);
+ gchar* hostname;
+ gchar* decoded;
+
+ if (!unescaped)
+ return g_strdup (uri);
+
+ hostname = sokoke_hostname_from_uri (unescaped, &path);
+ decoded = g_hostname_to_unicode (hostname);
if (decoded)
{
@@ -476,6 +482,10 @@ sokoke_format_uri_for_display (const gchar* uri)
return unescaped;
#elif HAVE_LIBIDN
gchar* decoded;
+
+ if (!unescaped)
+ return g_strdup (uri);
+
if (!idna_to_unicode_8z8z (unescaped, &decoded, 0) == IDNA_SUCCESS)
return unescaped;
g_free (unescaped);
More information about the Xfce4-commits
mailing list