Work on 13838 missing property checks

r=mstoltz
This commit is contained in:
norris@netscape.com
2000-01-14 00:08:44 +00:00
parent b85f23e2d4
commit 4cd17409a5
2 changed files with 42 additions and 15 deletions
+18
View File
@@ -27,6 +27,7 @@
#undef NS_IMPL_IDS
#include "nsCOMPtr.h"
#include "nsXPIDLString.h"
#include "nsID.h"
@@ -69,6 +70,7 @@ static NS_DEFINE_CID(kIOServiceCID, NS_IOSERVICE_CID);
#include "nsDocument.h"
#include "nsIDOMHTMLFormElement.h"
#include "nsIDOMNSHTMLFormElement.h"
#include "nsDOMError.h"
#include "nsHTMLParts.h"
#include "nsIReflowCommand.h"
@@ -625,6 +627,22 @@ nsFormFrame::OnSubmit(nsIPresContext* aPresContext, nsIFrame* aFrame)
{
return result;
}
nsXPIDLCString scheme;
if (NS_FAILED(result = actionURL->GetScheme(getter_Copies(scheme))))
return result;
if (nsCRT::strcmp(scheme, "mailto") == 0) {
PRBool enabled;
if (NS_FAILED(result = securityManager->IsCapabilityEnabled("UniversalSendMail",
&enabled)))
{
return result;
}
if (!enabled) {
// Form submit to a mailto: URI requires the UniversalSendMail privilege
return NS_ERROR_DOM_SECURITY_ERR;
}
}
}
nsAutoString target;