зеркало из https://github.com/mozilla/gecko-dev.git
Bug 685263 - don't parse leading "foo:" as a protocol when followed by a number. r=gavin
This commit is contained in:
Родитель
dce4bad08f
Коммит
b437c3941a
|
@ -62,6 +62,8 @@ function test() {
|
|||
testVal("<https://>mozilla.org</sub/file.ext?foo&bar#top>");
|
||||
|
||||
testVal("<https://sub.>mozilla.org<:666/file.ext>");
|
||||
testVal("<sub.>mozilla.org<:666/file.ext>");
|
||||
testVal("localhost<:666/file.ext>");
|
||||
|
||||
let IPs = ["192.168.1.1",
|
||||
"[::]",
|
||||
|
@ -87,6 +89,7 @@ function test() {
|
|||
IPs.forEach(function (IP) {
|
||||
testVal(IP);
|
||||
testVal(IP + "</file.ext>");
|
||||
testVal(IP + "<:666/file.ext>");
|
||||
testVal("<https://>" + IP);
|
||||
testVal("<https://>" + IP + "</file.ext>");
|
||||
testVal("<https://user:pass@>" + IP + "<:666/file.ext>");
|
||||
|
|
|
@ -204,7 +204,7 @@
|
|||
let textNode = this.editor.rootElement.firstChild;
|
||||
let value = textNode.textContent;
|
||||
|
||||
let protocol = value.match(/^[a-z\d.+\-]+:/);
|
||||
let protocol = value.match(/^[a-z\d.+\-]+:(?=[^\d])/);
|
||||
if (protocol &&
|
||||
["http:", "https:", "ftp:"].indexOf(protocol[0]) == -1)
|
||||
return;
|
||||
|
|
Загрузка…
Ссылка в новой задаче