]> git.armaanb.net Git - chorizo.git/commitdiff
Add missing call to g_uri_escape_string()
authorPeter Hofmann <scm@uninformativ.de>
Fri, 26 May 2017 16:05:48 +0000 (18:05 +0200)
committerPeter Hofmann <scm@uninformativ.de>
Fri, 26 May 2017 16:05:48 +0000 (18:05 +0200)
Closes #47.

CHANGES
browser.c

diff --git a/CHANGES b/CHANGES
index 0b97335ebc32bb8628e9f654253fe5a079e5b71e..f62ede22a5a0f023216cbb7cfac2a70bd6be4e50 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,5 +1,10 @@
 Release history for lariza
 
+next
+  [Fixed]
+  - User input is now properly escaped when used for keyword based
+    searching (fixes #47).
+
 v17.05  2017-05-21
   [Fixed]
   - Automatically adding the "file://" prefix didn't work (reliably) if
index 19c69849a4dc202c57ba40c75fe4d31b65070627..75688b9c06c4e8ad9e87e82a46ca9250c7a43ffb 100644 (file)
--- a/browser.c
+++ b/browser.c
@@ -880,7 +880,7 @@ keywords_try_search(WebKitWebView *web_view, const gchar *t)
 {
     gboolean ret = FALSE;
     gchar **tokens = NULL;
-    gchar *val = NULL, *uri = NULL;
+    gchar *val = NULL, *escaped = NULL, *uri = NULL;
 
     tokens = g_strsplit(t, " ", 2);
     if (tokens[0] != NULL && tokens[1] != NULL)
@@ -888,9 +888,11 @@ keywords_try_search(WebKitWebView *web_view, const gchar *t)
         val = g_hash_table_lookup(keywords, tokens[0]);
         if (val != NULL)
         {
-            uri = g_strdup_printf((gchar *)val, tokens[1]);
+            escaped = g_uri_escape_string(tokens[1], NULL, TRUE);
+            uri = g_strdup_printf((gchar *)val, escaped);
             webkit_web_view_load_uri(web_view, uri);
             g_free(uri);
+            g_free(escaped);
             ret = TRUE;
         }
     }