Skip to content

Commit

Permalink
limit forms to http[s]
Browse files Browse the repository at this point in the history
Change-Id: I3ed0bc626f693ec03f610dc7361f93cad914c9d8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93993
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
  • Loading branch information
Caolán McNamara authored and stbergmann committed May 12, 2020
1 parent 71c9aea commit 5d101a6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions forms/source/xforms/submission.cxx
Expand Up @@ -253,6 +253,9 @@ bool Submission::doSubmit( const Reference< XInteractionHandler >& xHandler )
return false;
}

if (!xSubmission->IsWebProtocol())
return false;

CSubmission::SubmissionResult aResult = xSubmission->submit( xHandler );

if (aResult == CSubmission::SUCCESS)
Expand Down
6 changes: 6 additions & 0 deletions forms/source/xforms/submission/submission.hxx
Expand Up @@ -126,6 +126,12 @@ public:
, m_xContext(::comphelper::getProcessComponentContext())
{}

bool IsWebProtocol() const
{
INetProtocol eProtocol = m_aURLObj.GetProtocol();
return eProtocol == INetProtocol::Http || eProtocol == INetProtocol::Https;
}

virtual ~CSubmission() {}

virtual SubmissionResult submit(const css::uno::Reference< css::task::XInteractionHandler >& ) = 0;
Expand Down

0 comments on commit 5d101a6

Please sign in to comment.