[epiphany] Encode the typed URL before passing it as a query string for searching
- From: Gustavo Noronha Silva <gns src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [epiphany] Encode the typed URL before passing it as a query string for searching
- Date: Wed, 7 Oct 2009 10:17:55 +0000 (UTC)
commit eb4d86050b88de7b29ff07ee59780994f02cc3cf
Author: Gustavo Noronha Silva <gns gnome org>
Date: Sun Oct 4 12:55:49 2009 +0100
Encode the typed URL before passing it as a query string for searching
This change makes sure that all characters that are typed make it to
the search query. Thanks to Dan Winship for pointing out the solution.
Bug #596717
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 3d16eab..acf3e5f 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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]