Fix crash when opening http://foo%40bar@baz

This commit is contained in:
Florian Bruhin 2016-08-01 17:18:14 +02:00
parent 1f930a579a
commit 5ec39b7540
3 changed files with 14 additions and 0 deletions

View File

@ -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
------

View File

@ -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)

View File

@ -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