From 4aa3ea89b388266b1860522bf23b7629b8019d78 Mon Sep 17 00:00:00 2001 From: Daniel Karbach Date: Thu, 29 Sep 2016 10:44:05 +0200 Subject: [PATCH 1/6] test for yanking URLs with ';' separated queries refs #1987 --- tests/end2end/features/yankpaste.feature | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/end2end/features/yankpaste.feature b/tests/end2end/features/yankpaste.feature index abb59ad47..1f24e40c4 100644 --- a/tests/end2end/features/yankpaste.feature +++ b/tests/end2end/features/yankpaste.feature @@ -57,6 +57,12 @@ Feature: Yanking and pasting. Then the message "Yanked URL to clipboard: http://localhost:(port)/data/title with spaces.html" should be shown And the clipboard should contain "http://localhost:(port)/data/title with spaces.html" + Scenario: Yanking URL that has = and ; in its query string + When I open data/title.html?a=b;c=d + And I run :yank + Then the message "Yanked URL to clipboard: http://localhost:(port)/data/title.html?a=b;c=d" should be shown + And the clipboard should contain "http://localhost:(port)/data/title.html?a=b;c=d" + #### {clipboard} and {primary} Scenario: Pasting a URL From b195b5b40d593ddb3a7cb5270b8fb499835c4e74 Mon Sep 17 00:00:00 2001 From: Daniel Karbach Date: Thu, 29 Sep 2016 11:02:30 +0200 Subject: [PATCH 2/6] detect ';' delimiters when yanking URL fixes #1987 --- qutebrowser/browser/commands.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/qutebrowser/browser/commands.py b/qutebrowser/browser/commands.py index 5e899aba1..873ad7517 100644 --- a/qutebrowser/browser/commands.py +++ b/qutebrowser/browser/commands.py @@ -682,7 +682,10 @@ class CommandDispatcher: else: flags |= QUrl.FullyEncoded url = QUrl(self._current_url()) - url_query = QUrlQuery(url) + url_query = QUrlQuery() + if ';' in url.query(): + url_query.setQueryDelimiters('=', ';') + url_query.setQuery(url.query()) for key in dict(url_query.queryItems()): if key in config.get('general', 'yank-ignored-url-parameters'): url_query.removeQueryItem(key) From ae674bc4ac96a501ad21b2c8d41e338892d1cd59 Mon Sep 17 00:00:00 2001 From: Daniel Karbach Date: Thu, 29 Sep 2016 11:04:38 +0200 Subject: [PATCH 3/6] test for yanking URLs with '&' in query for completeness' sake --- tests/end2end/features/yankpaste.feature | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/end2end/features/yankpaste.feature b/tests/end2end/features/yankpaste.feature index 1f24e40c4..0bb11204d 100644 --- a/tests/end2end/features/yankpaste.feature +++ b/tests/end2end/features/yankpaste.feature @@ -57,6 +57,12 @@ Feature: Yanking and pasting. Then the message "Yanked URL to clipboard: http://localhost:(port)/data/title with spaces.html" should be shown And the clipboard should contain "http://localhost:(port)/data/title with spaces.html" + Scenario: Yanking URL that has = and & in its query string + When I open data/title.html?a=b&c=d + And I run :yank + Then the message "Yanked URL to clipboard: http://localhost:(port)/data/title.html?a=b&c=d" should be shown + And the clipboard should contain "http://localhost:(port)/data/title.html?a=b&c=d" + Scenario: Yanking URL that has = and ; in its query string When I open data/title.html?a=b;c=d And I run :yank From 46ca91cfc04f246192197fb9035f290c6db4304d Mon Sep 17 00:00:00 2001 From: Daniel Karbach Date: Thu, 29 Sep 2016 17:45:12 +0200 Subject: [PATCH 4/6] only use ';' as query delim if there's no '&' --- qutebrowser/browser/commands.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/qutebrowser/browser/commands.py b/qutebrowser/browser/commands.py index 873ad7517..0590bc668 100644 --- a/qutebrowser/browser/commands.py +++ b/qutebrowser/browser/commands.py @@ -683,9 +683,10 @@ class CommandDispatcher: flags |= QUrl.FullyEncoded url = QUrl(self._current_url()) url_query = QUrlQuery() - if ';' in url.query(): + url_query_str = url.query() + if '&' not in url_query_str and ';' in url_query_str: url_query.setQueryDelimiters('=', ';') - url_query.setQuery(url.query()) + url_query.setQuery(url_query_str) for key in dict(url_query.queryItems()): if key in config.get('general', 'yank-ignored-url-parameters'): url_query.removeQueryItem(key) From bac22629e3974c5fa06433d41a33d890e27f5208 Mon Sep 17 00:00:00 2001 From: Daniel Karbach Date: Fri, 30 Sep 2016 09:15:05 +0200 Subject: [PATCH 5/6] test for yanking queries with both '&' and ';' --- tests/end2end/features/yankpaste.feature | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/end2end/features/yankpaste.feature b/tests/end2end/features/yankpaste.feature index 0bb11204d..bc9bc7ab6 100644 --- a/tests/end2end/features/yankpaste.feature +++ b/tests/end2end/features/yankpaste.feature @@ -69,6 +69,12 @@ Feature: Yanking and pasting. Then the message "Yanked URL to clipboard: http://localhost:(port)/data/title.html?a=b;c=d" should be shown And the clipboard should contain "http://localhost:(port)/data/title.html?a=b;c=d" + Scenario: Yanking URL with both & and ; in its query string + When I open data/title.html?a;b&c=d + And I run :yank + Then the message "Yanked URL to clipboard: http://localhost:(port)/data/title.html?a;b&c=d" should be shown + And the clipboard should contain "http://localhost:(port)/data/title.html?a;b&c=d" + #### {clipboard} and {primary} Scenario: Pasting a URL From 53e3eff19d7384043293dd39d7385be317cf30ee Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Mon, 3 Oct 2016 06:45:15 +0200 Subject: [PATCH 6/6] Regenerate authors --- README.asciidoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.asciidoc b/README.asciidoc index fc710ac98..693e4fb44 100644 --- a/README.asciidoc +++ b/README.asciidoc @@ -160,13 +160,13 @@ Contributors, sorted by the number of commits in descending order: * Corentin Julé * meles5 * Philipp Hansch +* Daniel Karbach * Panagiotis Ktistakis * Kevin Velghe * Artur Shaik * Nathan Isom * Thorsten Wißmann * Austin Anderson -* Daniel Karbach * Jimmy * Niklas Haas * Alexey "Averrin" Nabrodov