diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc index c75b373b8..d748c77a1 100644 --- a/CHANGELOG.asciidoc +++ b/CHANGELOG.asciidoc @@ -42,6 +42,7 @@ Fixed - Fixed crash when using hints with JS disabled in some rare circumstances. - When hinting input fields (`:t`), also consider input elements without a type. +- Fixed crash when opening an invalid URL with a percent-encoded and a real @ in it v0.8.1 ------ diff --git a/qutebrowser/browser/webkit/history.py b/qutebrowser/browser/webkit/history.py index e4774e499..3ede42cc7 100644 --- a/qutebrowser/browser/webkit/history.py +++ b/qutebrowser/browser/webkit/history.py @@ -295,6 +295,10 @@ class WebHistory(QObject): """ if config.get('general', 'private-browsing'): return + if not url.isValid(): + log.misc.warning("Ignoring invalid URL being added to history") + return + if atime is None: atime = time.time() entry = Entry(atime, url, title, redirect=redirect) diff --git a/tests/end2end/features/history.feature b/tests/end2end/features/history.feature index fab89f1fc..1cd680d7e 100644 --- a/tests/end2end/features/history.feature +++ b/tests/end2end/features/history.feature @@ -51,3 +51,12 @@ Feature: Page history When I open data/title.html And I run :history-clear Then the history file should be empty + + ## Bugs + + Scenario: Opening a valid URL which turns out invalid + When I set general -> auto-search to true + And I run :open http://foo%40bar@baz + Then "QFSFileEngine::open: No file name specified" should be logged + And "Error while loading : Host not found" should be logged + And "Ignoring invalid URL being added to history" should be logged