Bug 1053245 - ignore number-only hosts in showing notification bars for keyword URI redirection, r=jaws

--HG--
extra : rebase_source : bd1932037f7b2db212db5943a12ae7d377b49bbe
This commit is contained in:
Gijs Kruitbosch 2014-08-13 21:04:03 +01:00
parent cb499691f2
commit 48c278d59e
2 changed files with 10 additions and 0 deletions

View File

@ -806,6 +806,10 @@ function gKeywordURIFixup(fixupInfo, topic, data) {
asciiHost = asciiHost.slice(0, -1); asciiHost = asciiHost.slice(0, -1);
} }
// Ignore number-only things entirely (no decimal IPs for you!)
if (/^\d+$/.test(asciiHost))
return;
let onLookupComplete = (request, record, status) => { let onLookupComplete = (request, record, status) => {
let browser = weakBrowser.get(); let browser = weakBrowser.get();
if (!Components.isSuccessCode(status) || !browser) if (!Components.isSuccessCode(status) || !browser)

View File

@ -62,6 +62,12 @@ add_task(function* test_navigate_full_domain() {
gBrowser.removeTab(tab); gBrowser.removeTab(tab);
}); });
add_task(function* test_navigate_numbers() {
let tab = gBrowser.selectedTab = gBrowser.addTab();
yield* runURLBarSearchTest("1234", true, false);
gBrowser.removeTab(tab);
});
function get_test_function_for_localhost_with_hostname(hostName, isPrivate) { function get_test_function_for_localhost_with_hostname(hostName, isPrivate) {
return function* test_navigate_single_host() { return function* test_navigate_single_host() {
const pref = "browser.fixup.domainwhitelist.localhost"; const pref = "browser.fixup.domainwhitelist.localhost";