зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1495327 - Specially forged Text Pasted into the Address Bar Causes Firefox to Freeze. r=adw
Differential Revision: https://phabricator.services.mozilla.com/D8239 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
06ff704ff3
Коммит
0993f93347
|
@ -508,7 +508,9 @@ function looksLikeUrl(str, ignoreAlphanumericHosts = false) {
|
|||
// Single word including special chars.
|
||||
return !REGEXP_SPACES.test(str) &&
|
||||
(["/", "@", ":", "["].some(c => str.includes(c)) ||
|
||||
(ignoreAlphanumericHosts ? /(.*\..*){3,}/.test(str) : str.includes(".")));
|
||||
(ignoreAlphanumericHosts ?
|
||||
/^([\[\]A-Z0-9.:-]+[\.:]){3,}[\[\]A-Z0-9.:-]+$/i.test(str) :
|
||||
str.includes(".")));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Загрузка…
Ссылка в новой задаче