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:
kaie%kuix.de 2006-03-01 23:38:30 +00:00
parent 9c5e61a284
commit c3311666d5
2 changed files with 16 additions and 1 deletions

View File

@ -73,6 +73,7 @@ REQUIRES = nspr \
widget \
layout \
content \
caps \
pref \
$(NULL)

View File

@ -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());