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:
timeless%mozdev.org 2003-04-20 21:01:24 +00:00
parent be23a13ac7
commit ec6c1ba5d3

View File

@ -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 {