From: Christian Dywan Date: Thu, 2 Apr 2009 20:48:07 +0000 (+0200) Subject: Allow opening data URIs from the location entry X-Git-Url: https://spindle.queued.net/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=406942594aa76eb35ffa9e48312036633b0efb50;p=midori Allow opening data URIs from the location entry --- diff --git a/midori/sokoke.c b/midori/sokoke.c index dcdfd789..98b59ffe 100644 --- a/midori/sokoke.c +++ b/midori/sokoke.c @@ -221,7 +221,9 @@ sokoke_magic_uri (const gchar* uri, katze_array_is_a (search_engines, KATZE_TYPE_ITEM), NULL); /* Just return if it's a javascript: or mailto: uri */ - if (g_str_has_prefix (uri, "javascript:") || g_str_has_prefix (uri, "mailto:")) + if (g_str_has_prefix (uri, "javascript:") + || g_str_has_prefix (uri, "mailto:") + || g_str_has_prefix (uri, "data:")) return g_strdup (uri); /* Add file:// if we have a local path */ if (g_path_is_absolute (uri)) diff --git a/tests/magic-uri.c b/tests/magic-uri.c index f03a0a8c..4611959f 100644 --- a/tests/magic-uri.c +++ b/tests/magic-uri.c @@ -137,6 +137,8 @@ magic_uri_pseudo (void) { test_input ("javascript:alert(1)", "javascript:alert(1)"); test_input ("mailto:christian@twotoasts.de", "mailto:christian@twotoasts.de"); + test_input ("data:text/html;charset=utf-8,TestTest", + "data:text/html;charset=utf-8,TestTest"); } static void