mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 22:01:30 +00:00
bug 168629, Mozilla incorrectly prompts about submitting to an insecure location from a secure one with base
href="https://..." r=rrelyea, sr=bzbarsky
This commit is contained in:
parent
9c5e61a284
commit
c3311666d5
@ -73,6 +73,7 @@ REQUIRES = nspr \
|
||||
widget \
|
||||
layout \
|
||||
content \
|
||||
caps \
|
||||
pref \
|
||||
$(NULL)
|
||||
|
||||
|
@ -60,6 +60,7 @@
|
||||
#include "nsIDocShell.h"
|
||||
#include "nsIDocumentViewer.h"
|
||||
#include "nsIDocument.h"
|
||||
#include "nsIPrincipal.h"
|
||||
#include "nsIDOMElement.h"
|
||||
#include "nsPIDOMWindow.h"
|
||||
#include "nsIContent.h"
|
||||
@ -358,7 +359,20 @@ nsSecureBrowserUIImpl::Notify(nsIContent* formNode,
|
||||
nsCOMPtr<nsIDocument> document = formNode->GetDocument();
|
||||
if (!document) return NS_OK;
|
||||
|
||||
nsIURI *formURL = document->GetBaseURI();
|
||||
nsIPrincipal *principal = formNode->GetNodePrincipal();
|
||||
|
||||
if (!principal)
|
||||
{
|
||||
*cancelSubmit = PR_TRUE;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIURI> formURL;
|
||||
if (NS_FAILED(principal->GetURI(getter_AddRefs(formURL))) ||
|
||||
!formURL)
|
||||
{
|
||||
formURL = document->GetDocumentURI();
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIDOMWindow> postingWindow =
|
||||
do_QueryInterface(document->GetWindow());
|
||||
|
Loading…
Reference in New Issue
Block a user