Bug 392079 - Don't pass bad URIs from link elements beyond extractFromPage. r=myk

This commit is contained in:
rflint%ryanflint.com 2007-08-15 06:18:30 +00:00
Родитель 8457ddba3e
Коммит ee93e4512a
2 изменённых файлов: 5 добавлений и 15 удалений

Просмотреть файл

@ -1560,16 +1560,9 @@ MicrosummarySet.prototype = {
resource.content.characterSet,
null);
try {
const securityManager = Cc["@mozilla.org/scriptsecuritymanager;1"].
getService(Ci.nsIScriptSecurityManager);
securityManager.checkLoadURI(resource.uri,
generatorURI,
Ci.nsIScriptSecurityManager.DISALLOW_SCRIPT);
}
catch(e) {
if (!/^https?$/i.test(generatorURI.scheme)) {
LOG("can't load generator " + generatorURI.spec + " from page " +
resource.uri.spec + ": " + e);
resource.uri.spec);
continue;
}

Просмотреть файл

@ -574,12 +574,9 @@ var BookmarkPropertiesPanel = {
this._bookmarkId);
}
catch(ex) {
// getMicrosummaries will throw an exception in at least two cases:
// 1. the bookmarked URI contains a scheme that the service won't
// download for security reasons (currently it only handles http,
// https, and file);
// 2. the page to which the URI refers isn't HTML or XML (the only two
// content types the service knows how to summarize).
// getMicrosummaries will throw an exception if the page to which the URI
// refers isn't HTML or XML (the only two content types the service knows
// how to summarize).
this._microsummaries = null;
}
if (this._microsummaries) {