gint n;
new_uri = sokoke_magic_uri (uri, browser->search_engines);
- if (!new_uri && strstr (browser->location_entry_search, "%s"))
- new_uri = g_strdup_printf (browser->location_entry_search, uri);
- else if (!new_uri)
- new_uri = g_strconcat (browser->location_entry_search, uri, NULL);
+ if (!new_uri)
+ {
+ gchar* uri_ = g_uri_escape_string (uri, " :/", TRUE);
+ if (strstr (browser->location_entry_search, "%s"))
+ new_uri = g_strdup_printf (browser->location_entry_search, uri_);
+ else if (!new_uri)
+ new_uri = g_strconcat (browser->location_entry_search, uri_, NULL);
+ g_free (uri_);
+ }
if (new_tab)
{
if (parts[0] && parts[1])
if ((item = katze_array_find_token (search_engines, parts[0])))
{
+ gchar* uri_ = g_uri_escape_string (parts[1], " :/", TRUE);
search_uri = katze_item_get_uri (item);
if (strstr (search_uri, "%s"))
- search = g_strdup_printf (search_uri, parts[1]);
+ search = g_strdup_printf (search_uri, uri_);
else
- search = g_strdup_printf ("%s%s", search_uri, parts[1]);
+ search = g_strconcat (search_uri, uri_, NULL);
+ g_free (uri_);
}
g_strfreev (parts);
return search;
test_input ("cats dogs", NULL);
test_input ("gtk 2.0", NULL);
test_input ("gtk2.0", NULL);
+ test_input ("pcre++", NULL);
+ test_input ("sm pcre++", SM "pcre%2B%2B");
test_input ("midori0.1.0", NULL);
test_input ("midori 0.1.0", NULL);
test_input ("search:cats", NULL);