mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-10 11:55:49 +00:00
Bug 202319 use s? instead of (s)? in regexp because we don't care about the s
r=biesi sr=rbs
This commit is contained in:
parent
be23a13ac7
commit
ec6c1ba5d3
@ -383,8 +383,8 @@ function openLink(node)
|
|||||||
// Security-Critical: Only links to 'safe' protocols should be functional.
|
// Security-Critical: Only links to 'safe' protocols should be functional.
|
||||||
// Specifically, javascript: and data: URLs must be made non-functional
|
// Specifically, javascript: and data: URLs must be made non-functional
|
||||||
// here, because they will run with full privilege.
|
// here, because they will run with full privilege.
|
||||||
var safeurls = /(^http(s)?:|^file:|^chrome:|^resource:|^mailbox:|^imap:|^(s)?news:|^nntp:|^about:|^mailto:|^ftp:|^gopher:)/i;
|
var safeurls = /^https?:|^file:|^chrome:|^resource:|^mailbox:|^imap:|^s?news:|^nntp:|^about:|^mailto:|^ftp:|^gopher:/i;
|
||||||
if (url.search(safeurls) == 0) {
|
if (safeurls.test(url)) {
|
||||||
var secMan = Components.classes["@mozilla.org/scriptsecuritymanager;1"].getService().
|
var secMan = Components.classes["@mozilla.org/scriptsecuritymanager;1"].getService().
|
||||||
QueryInterface(nsIScriptSecurityManager);
|
QueryInterface(nsIScriptSecurityManager);
|
||||||
try {
|
try {
|
||||||
|
Loading…
Reference in New Issue
Block a user