Bug 451958. Add more CheckLoadURIs (part 3). r+sr=roc

--HG--
extra : rebase_source : e4fbaea74fa01592896982d4c3862fa8a0ad86dd
This commit is contained in:
Chris Pearce 2009-01-25 21:07:54 +13:00
Родитель 13da3bdfba
Коммит 94c30b7a97
1 изменённых файлов: 11 добавлений и 0 удалений

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

@ -286,6 +286,17 @@ nsresult nsFileStreamStrategy::Open(nsIStreamListener** aStreamListener)
rv = NS_NewLocalFileInputStream(getter_AddRefs(mInput), file);
} else {
// Ensure that we never load a local file from some page on a
// web server.
nsHTMLMediaElement* element = mDecoder->GetMediaElement();
NS_ENSURE_TRUE(element, NS_ERROR_FAILURE);
rv = nsContentUtils::GetSecurityManager()->
CheckLoadURIWithPrincipal(element->NodePrincipal(),
mURI,
nsIScriptSecurityManager::STANDARD);
NS_ENSURE_SUCCESS(rv, rv);
rv = mChannel->Open(getter_AddRefs(mInput));
}
NS_ENSURE_SUCCESS(rv, rv);