From: Christian Dywan Date: Mon, 9 Feb 2009 21:03:04 +0000 (+0100) Subject: Tweak magic URI and add a test string X-Git-Url: https://spindle.queued.net/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=60e81f734b5eb61219df25cf61f11d2d1a594f8b;p=midori Tweak magic URI and add a test string --- diff --git a/midori/sokoke.c b/midori/sokoke.c index 78f822cd..8b409f24 100644 --- a/midori/sokoke.c +++ b/midori/sokoke.c @@ -155,7 +155,8 @@ sokoke_magic_uri (const gchar* uri, { /* Do we have a domain, ip address or localhost? */ search = strchr (uri, ':'); - if (search && search[0] && !g_ascii_isalpha (search[1])) + if (search && search[0] && + !g_ascii_isalpha (search[1]) && search[1] != ' ') if (!strchr (search, '.')) return g_strconcat ("http://", uri, NULL); if (!strcmp (uri, "localhost") || g_str_has_prefix (uri, "localhost/")) diff --git a/tests/magic-uri.c b/tests/magic-uri.c index 5192fac3..3fd83367 100644 --- a/tests/magic-uri.c +++ b/tests/magic-uri.c @@ -92,6 +92,8 @@ main (int argc, test_input ("g de.po verbose", NULL); test_input ("sm de.po verbose", SM "de.po verbose"); test_input ("javascript:alert(1)", "javascript:alert(1)"); + test_input ("sm warning: configure /dev/net: virtual", + SM "warning: configure /dev/net: virtual"); return 0; }