Tweak magic URI and add a test string

This commit is contained in:
Christian Dywan 2009-02-09 22:03:04 +01:00
parent c0c4d6f1cb
commit 60e81f734b
2 changed files with 4 additions and 1 deletions

View file

@ -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/"))

View file

@ -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;
}