diff options
author | New Tobin Paradigm <email@mattatobin.com> | 2018-04-16 08:25:45 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-16 08:25:45 -0400 |
commit | ba80720469e27d3d7ae6f1095b3c187207adc051 (patch) | |
tree | f864e580c5cd7d99127aac64e9c3ae0ee6e9aa4b /toolkit | |
parent | a66e6546c361d238b0179af18e26bf18aa4a7eb9 (diff) | |
parent | ae14556114dcae29f679db7c15f0bc9b707bb89a (diff) | |
download | UXP-ba80720469e27d3d7ae6f1095b3c187207adc051.tar UXP-ba80720469e27d3d7ae6f1095b3c187207adc051.tar.gz UXP-ba80720469e27d3d7ae6f1095b3c187207adc051.tar.lz UXP-ba80720469e27d3d7ae6f1095b3c187207adc051.tar.xz UXP-ba80720469e27d3d7ae6f1095b3c187207adc051.zip |
Merge pull request #174 from janekptacijarabaci/url_parser_1
moebius#130: URL parser - fix: don't allow empty host name
Diffstat (limited to 'toolkit')
-rw-r--r-- | toolkit/components/passwordmgr/test/unit/test_logins_search.js | 1 | ||||
-rw-r--r-- | toolkit/components/places/UnifiedComplete.js | 2 | ||||
-rw-r--r-- | toolkit/components/places/nsNavHistory.cpp | 4 |
3 files changed, 5 insertions, 2 deletions
diff --git a/toolkit/components/passwordmgr/test/unit/test_logins_search.js b/toolkit/components/passwordmgr/test/unit/test_logins_search.js index 188c75039..730771981 100644 --- a/toolkit/components/passwordmgr/test/unit/test_logins_search.js +++ b/toolkit/components/passwordmgr/test/unit/test_logins_search.js @@ -192,7 +192,6 @@ add_task(function test_search_all_full_case_sensitive() { checkAllSearches({ hostname: "http://www.example.com" }, 1); checkAllSearches({ hostname: "http://www.example.com/" }, 0); - checkAllSearches({ hostname: "http://" }, 0); checkAllSearches({ hostname: "example.com" }, 0); checkAllSearches({ formSubmitURL: "http://www.example.com" }, 2); diff --git a/toolkit/components/places/UnifiedComplete.js b/toolkit/components/places/UnifiedComplete.js index ad3d35aab..acd358b11 100644 --- a/toolkit/components/places/UnifiedComplete.js +++ b/toolkit/components/places/UnifiedComplete.js @@ -1245,7 +1245,7 @@ Search.prototype = { // * If the protocol differs we should not match. For example if the user // searched https we should not return http. try { - let prefixURI = NetUtil.newURI(this._strippedPrefix); + let prefixURI = NetUtil.newURI(this._strippedPrefix + match.token); let finalURI = NetUtil.newURI(match.url); if (prefixURI.scheme != finalURI.scheme) return false; diff --git a/toolkit/components/places/nsNavHistory.cpp b/toolkit/components/places/nsNavHistory.cpp index 8cf3a2e32..7f4007c1a 100644 --- a/toolkit/components/places/nsNavHistory.cpp +++ b/toolkit/components/places/nsNavHistory.cpp @@ -949,6 +949,10 @@ nsresult // static nsNavHistory::AsciiHostNameFromHostString(const nsACString& aHostName, nsACString& aAscii) { + aAscii.Truncate(); + if (aHostName.IsEmpty()) { + return NS_OK; + } // To properly generate a uri we must provide a protocol. nsAutoCString fakeURL("http://"); fakeURL.Append(aHostName); |