1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-22 20:37:58 +01:00

remove the "a" prefix from the parameters of isValidFeed()

This commit is contained in:
Doug Kearns
2007-11-16 12:57:09 +00:00
parent f50bca0453
commit 49cfef959f

View File

@@ -534,43 +534,43 @@ vimperator.Buffer = function () //{{{
"application/rdf+xml": "XML" "application/rdf+xml": "XML"
}; };
function isValidFeed(aData, aPrincipal, aIsFeed) function isValidFeed(data, principal, isFeed)
{ {
if (!aData || !aPrincipal) if (!data || !principal)
return false; return false;
if (!aIsFeed) if (!isFeed)
{ {
var type = aData.type && aData.type.toLowerCase(); var type = data.type && data.type.toLowerCase();
type = type.replace(/^\s+|\s*(?:;.*)?$/g, ""); type = type.replace(/^\s+|\s*(?:;.*)?$/g, "");
aIsFeed = (type == "application/rss+xml" || type == "application/atom+xml"); isFeed = (type == "application/rss+xml" || type == "application/atom+xml");
if (!aIsFeed) if (!isFeed)
{ {
// really slimy: general XML types with magic letters in the title // really slimy: general XML types with magic letters in the title
const titleRegex = /(^|\s)rss($|\s)/i; const titleRegex = /(^|\s)rss($|\s)/i;
aIsFeed = ((type == "text/xml" || type == "application/rdf+xml" || isFeed = ((type == "text/xml" || type == "application/rdf+xml" ||
type == "application/xml") && titleRegex.test(aData.title)); type == "application/xml") && titleRegex.test(data.title));
} }
} }
if (aIsFeed) if (isFeed)
{ {
try try
{ {
urlSecurityCheck(aData.href, aPrincipal, urlSecurityCheck(data.href, principal,
Components.interfaces.nsIScriptSecurityManager.DISALLOW_INHERIT_PRINCIPAL); Components.interfaces.nsIScriptSecurityManager.DISALLOW_INHERIT_PRINCIPAL);
} }
catch (ex) catch (ex)
{ {
aIsFeed = false; isFeed = false;
} }
} }
if (type) if (type)
aData.type = type; data.type = type;
return aIsFeed; return isFeed;
} }
// TODO: could this be useful for other commands? // TODO: could this be useful for other commands?