mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-26 22:32:46 +00:00
Bug 56851, regression in XPInstall dialog. r=jst, sr=vidur
This commit is contained in:
parent
3a0fc9c277
commit
ea75b7e1ad
@ -3044,13 +3044,16 @@ NS_IMETHODIMP GlobalWindowImpl::OpenInternal(JSContext *cx,
|
||||
nsCOMPtr<nsIScriptSecurityManager> secMan;
|
||||
if (uriToLoad) {
|
||||
// Get security manager, check to see if URI is allowed.
|
||||
// Don't call CheckLoadURI for dialogs - see bug 56851
|
||||
// The security of this function depends on window.openDialog being
|
||||
// inaccessible from web scripts
|
||||
nsCOMPtr<nsIURI> newUrl;
|
||||
nsCOMPtr<nsIScriptContext> scriptCX;
|
||||
nsJSUtils::nsGetStaticScriptContext(cx, (JSObject *) mScriptObject,
|
||||
getter_AddRefs(scriptCX));
|
||||
if (!scriptCX ||
|
||||
NS_FAILED(scriptCX->GetSecurityManager(getter_AddRefs(secMan))) ||
|
||||
NS_FAILED(secMan->CheckLoadURIFromScript(cx, uriToLoad)))
|
||||
((!aDialog && NS_FAILED(secMan->CheckLoadURIFromScript(cx, uriToLoad)))))
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user