diff options
-rw-r--r-- | embed/ephy-web-view.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/embed/ephy-web-view.c b/embed/ephy-web-view.c index 3d16eab0a..acf3e5f0b 100644 --- a/embed/ephy-web-view.c +++ b/embed/ephy-web-view.c @@ -1110,9 +1110,12 @@ ephy_web_view_load_url (EphyWebView *view, /* If the string doesn't look like an URI, let's search it; */ if (soup_uri == NULL && priv->non_search_regex && - !g_regex_match (priv->non_search_regex, url, 0, NULL)) - effective_url = g_strdup_printf (_("http://www.google.com/search?q=%s&ie=UTF-8&oe=UTF-8"), url); - else + !g_regex_match (priv->non_search_regex, url, 0, NULL)) { + char *query_param = soup_form_encode ("q", url, NULL); + /* + 2 here is getting rid of 'q=' */ + effective_url = g_strdup_printf (_("http://www.google.com/search?q=%s&ie=UTF-8&oe=UTF-8"), query_param + 2); + g_free (query_param); + } else effective_url = ephy_embed_utils_normalize_address (url); webkit_web_view_open (WEBKIT_WEB_VIEW (view), effective_url); |