summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-05-11 20:46:43 +0100
committerThorsten Behrens <Thorsten.Behrens@CIB.de>2020-11-23 10:23:39 +0100
commit07a618345d4ce0d01f500c5d2899854324f60854 (patch)
tree386520fdcd37e7e805a43fd8d44b89804e8e085a
parent34370f3ae03897252dfbdb9ece8f04134825b094 (diff)
limit forms to http[s]
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94015 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@cib.de> Reviewed-by: Caolán McNamara <caolanm@redhat.com> (cherry picked from commit a5458d1f219c8a67d2c4c90fdbdf8ffba40d769d) Change-Id: I3ed0bc626f693ec03f610dc7361f93cad914c9d8
-rw-r--r--forms/source/xforms/submission.cxx4
-rw-r--r--forms/source/xforms/submission/submission.hxx6
2 files changed, 10 insertions, 0 deletions
diff --git a/forms/source/xforms/submission.cxx b/forms/source/xforms/submission.cxx
index 1559bb8756a0..a96918c9090d 100644
--- a/forms/source/xforms/submission.cxx
+++ b/forms/source/xforms/submission.cxx
@@ -323,7 +323,11 @@ bool Submission::doSubmit( const Reference< XInteractionHandler >& xHandler )
return false;
}
+ if (!xSubmission->IsWebProtocol())
+ return false;
+
xSubmission->setEncoding(getEncoding());
+
CSubmission::SubmissionResult aResult = xSubmission->submit( xHandler );
if (aResult == CSubmission::SUCCESS)
diff --git a/forms/source/xforms/submission/submission.hxx b/forms/source/xforms/submission/submission.hxx
index e70df209c90c..6301e1706855 100644
--- a/forms/source/xforms/submission/submission.hxx
+++ b/forms/source/xforms/submission/submission.hxx
@@ -136,6 +136,12 @@ public:
, m_xContext(::comphelper::getProcessComponentContext())
{}
+ bool IsWebProtocol() const
+ {
+ INetProtocol eProtocol = m_aURLObj.GetProtocol();
+ return eProtocol == INET_PROT_HTTP || eProtocol == INET_PROT_HTTPS;
+ }
+
virtual ~CSubmission() {}
virtual void setEncoding(const OUString& aEncoding)