From f6f0951fbddd34c1940ce9ea8a3b4e8b2b6c51a6 Mon Sep 17 00:00:00 2001 From: "scott%scott-macgregor.org" Date: Fri, 19 Jan 2007 23:32:29 +0000 Subject: [PATCH] Bug #360814 --> remote content in custom start pages is getting blocked by the content policy manager. sr=bienvenu git-svn-id: svn://10.0.0.236/trunk@218688 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/mailnews/base/src/nsMsgContentPolicy.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/mozilla/mailnews/base/src/nsMsgContentPolicy.cpp b/mozilla/mailnews/base/src/nsMsgContentPolicy.cpp index 0e0c8f63578..f99629b01d0 100644 --- a/mozilla/mailnews/base/src/nsMsgContentPolicy.cpp +++ b/mozilla/mailnews/base/src/nsMsgContentPolicy.cpp @@ -397,6 +397,21 @@ nsresult nsMsgContentPolicy::MailShouldLoad(nsIURI * aRequestingLocation, nsIURI { NS_ENSURE_TRUE(aRequestingLocation, NS_OK); + // Allow remote content when using a remote start page in the message pane. + // aRequestingLocation is the url currently loaded in the message pane. + // If that's an http / https url (as opposed to a mail url) then we + // must be loading a start page and not a message. + PRBool isHttp; + PRBool isHttps; + nsresult rv = aRequestingLocation->SchemeIs("http", &isHttp); + rv |= aRequestingLocation->SchemeIs("https", &isHttps); + if (NS_SUCCEEDED(rv) && (isHttp || isHttps)) + { + *aDecision = nsIContentPolicy::ACCEPT; + return NS_OK; + } + + // (1) examine the msg hdr value for the remote content policy on this particular message to // see if this particular message has special rights to bypass the remote content check // (2) special case RSS urls, always allow them to load remote images since the user explicitly @@ -405,7 +420,6 @@ nsresult nsMsgContentPolicy::MailShouldLoad(nsIURI * aRequestingLocation, nsIURI // who are allowed to send us remote images // get the msg hdr for the message URI we are actually loading - nsresult rv; nsCOMPtr msgUrl = do_QueryInterface(aRequestingLocation, &rv); NS_ENSURE_SUCCESS(rv, rv);