mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-29 07:42:04 +00:00
Bug 1047393
- fix crash in nsIURIFixup, r=gavin
--HG-- extra : rebase_source : 054a4d4e0f0893f7497390071cc3a1c59f8af575
This commit is contained in:
parent
98f4f1ce42
commit
1340beff86
@ -960,7 +960,8 @@ void nsDefaultURIFixup::KeywordURIFixup(const nsACString & aURIString,
|
||||
colonLoc == uint32_t(kNotFound) && qMarkLoc == uint32_t(kNotFound))
|
||||
{
|
||||
nsAutoCString asciiHost;
|
||||
if (NS_SUCCEEDED(aFixupInfo->mFixedURI->GetAsciiHost(asciiHost)) &&
|
||||
if (aFixupInfo->mFixedURI &&
|
||||
NS_SUCCEEDED(aFixupInfo->mFixedURI->GetAsciiHost(asciiHost)) &&
|
||||
!asciiHost.IsEmpty())
|
||||
{
|
||||
// Check if this domain is whitelisted as an actual
|
||||
|
@ -59,7 +59,8 @@ let testcases = [
|
||||
["test.", "http://test./", "http://www.test./", true, true],
|
||||
[".test", "http://.test/", "http://www..test/", true, true],
|
||||
["mozilla is amazing", null, null, true, true],
|
||||
["", null, null, true, true]
|
||||
["", null, null, true, true],
|
||||
["[]", null, null, true, true]
|
||||
];
|
||||
|
||||
if (Services.appinfo.OS.toLowerCase().startsWith("win")) {
|
||||
@ -114,7 +115,7 @@ function run_test() {
|
||||
|
||||
// Check the preferred URI
|
||||
if (couldDoKeywordLookup && expectKeywordLookup) {
|
||||
let urlparamInput = testInput.replace(/ /g, '+');
|
||||
let urlparamInput = encodeURIComponent(testInput).replace("%20", "+", "g");
|
||||
let searchURL = kSearchEngineURL.replace("{searchTerms}", urlparamInput);
|
||||
do_check_eq(info.preferredURI.spec, searchURL);
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user