Only split URI if no domain pattern is found in the string
This commit is contained in:
parent
060c0b6940
commit
0243e26bed
1 changed files with 13 additions and 10 deletions
|
@ -622,8 +622,10 @@ sokoke_magic_uri (const gchar* uri,
|
||||||
return sokoke_idn_to_punycode (g_strconcat ("http://", uri, NULL));
|
return sokoke_idn_to_punycode (g_strconcat ("http://", uri, NULL));
|
||||||
if (!strncmp (uri, "localhost", 9) && (uri[9] == '\0' || uri[9] == '/'))
|
if (!strncmp (uri, "localhost", 9) && (uri[9] == '\0' || uri[9] == '/'))
|
||||||
return g_strconcat ("http://", uri, NULL);
|
return g_strconcat ("http://", uri, NULL);
|
||||||
|
if (!search)
|
||||||
|
{
|
||||||
parts = g_strsplit (uri, ".", 0);
|
parts = g_strsplit (uri, ".", 0);
|
||||||
if (!search && parts[0] && parts[1])
|
if (parts[0] && parts[1])
|
||||||
{
|
{
|
||||||
if (!(parts[1][1] == '\0' && !g_ascii_isalpha (parts[1][0])))
|
if (!(parts[1][1] == '\0' && !g_ascii_isalpha (parts[1][0])))
|
||||||
if (!strchr (parts[0], ' ') && !strchr (parts[1], ' '))
|
if (!strchr (parts[0], ' ') && !strchr (parts[1], ' '))
|
||||||
|
@ -634,6 +636,7 @@ sokoke_magic_uri (const gchar* uri,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
g_strfreev (parts);
|
g_strfreev (parts);
|
||||||
|
}
|
||||||
/* We don't want to search? So return early. */
|
/* We don't want to search? So return early. */
|
||||||
if (!search_engines)
|
if (!search_engines)
|
||||||
return g_strdup (uri);
|
return g_strdup (uri);
|
||||||
|
|
Loading…
Reference in a new issue