From 31a122e97be807fa954920eaec38f826f8a74c8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thorsten=20Wi=C3=9Fmann?= Date: Wed, 21 Nov 2018 17:27:32 +0100 Subject: [PATCH] Encode slashes in search terms for searchengines If a search term contains a slash, this should be encoded. While this makes no differences for search engines of the form http://example.org?q={} it does for engines like these: http://example.org/search/{} For a real world example, try: https://www.doi2bib.org/bib/{} --- qutebrowser/utils/urlutils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qutebrowser/utils/urlutils.py b/qutebrowser/utils/urlutils.py index 4dda6b3fc..6687b9834 100644 --- a/qutebrowser/utils/urlutils.py +++ b/qutebrowser/utils/urlutils.py @@ -116,7 +116,7 @@ def _get_search_url(txt): if engine is None: engine = 'DEFAULT' template = config.val.url.searchengines[engine] - url = qurl_from_user_input(template.format(urllib.parse.quote(term))) + url = qurl_from_user_input(template.format(urllib.parse.quote(term, safe=''))) if config.val.url.open_base_url and term in config.val.url.searchengines: url = qurl_from_user_input(config.val.url.searchengines[term])