From a3f1e2295bd9733003a2c3c679cda4bbefd97ba5 Mon Sep 17 00:00:00 2001 From: "hyatt%netscape.com" Date: Thu, 17 Aug 2000 00:10:40 +0000 Subject: [PATCH] Fix for 48083. r=danm git-svn-id: svn://10.0.0.236/trunk@76514 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/chrome/src/nsChromeProtocolHandler.cpp | 10 ++++++++++ mozilla/rdf/chrome/src/nsChromeProtocolHandler.cpp | 10 ++++++++++ 2 files changed, 20 insertions(+) diff --git a/mozilla/chrome/src/nsChromeProtocolHandler.cpp b/mozilla/chrome/src/nsChromeProtocolHandler.cpp index 6714260dba7..59952ebd82f 100644 --- a/mozilla/chrome/src/nsChromeProtocolHandler.cpp +++ b/mozilla/chrome/src/nsChromeProtocolHandler.cpp @@ -37,6 +37,7 @@ #include "nsIEventQueueService.h" #include "nsIIOService.h" #include "nsILoadGroup.h" +#include "nsIResChannel.h" #include "nsIScriptSecurityManager.h" #include "nsIStreamListener.h" #include "nsIServiceManager.h" @@ -694,6 +695,15 @@ nsChromeProtocolHandler::NewChannel(nsIURI* aURI, rv = serv->NewChannelFromURI(chromeURI, getter_AddRefs(result)); if (NS_FAILED(rv)) return rv; + // XXX Will be removed someday when we handle remote chrome. + nsCOMPtr res(do_QueryInterface(result)); + nsCOMPtr file(do_QueryInterface(result)); + if (!res && !file) { + NS_WARNING("Remote chrome not allowed! Only file: and resource: are valid.\n"); + result = nsnull; + return NS_ERROR_FAILURE; + } + // Make sure that the channel remembers where it was // originally loaded from. rv = result->SetOriginalURI(aURI); diff --git a/mozilla/rdf/chrome/src/nsChromeProtocolHandler.cpp b/mozilla/rdf/chrome/src/nsChromeProtocolHandler.cpp index 6714260dba7..59952ebd82f 100644 --- a/mozilla/rdf/chrome/src/nsChromeProtocolHandler.cpp +++ b/mozilla/rdf/chrome/src/nsChromeProtocolHandler.cpp @@ -37,6 +37,7 @@ #include "nsIEventQueueService.h" #include "nsIIOService.h" #include "nsILoadGroup.h" +#include "nsIResChannel.h" #include "nsIScriptSecurityManager.h" #include "nsIStreamListener.h" #include "nsIServiceManager.h" @@ -694,6 +695,15 @@ nsChromeProtocolHandler::NewChannel(nsIURI* aURI, rv = serv->NewChannelFromURI(chromeURI, getter_AddRefs(result)); if (NS_FAILED(rv)) return rv; + // XXX Will be removed someday when we handle remote chrome. + nsCOMPtr res(do_QueryInterface(result)); + nsCOMPtr file(do_QueryInterface(result)); + if (!res && !file) { + NS_WARNING("Remote chrome not allowed! Only file: and resource: are valid.\n"); + result = nsnull; + return NS_ERROR_FAILURE; + } + // Make sure that the channel remembers where it was // originally loaded from. rv = result->SetOriginalURI(aURI);