diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-01-10 14:27:35 +0000 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2018-02-09 11:27:18 +0100 |
commit | 4c583da678dcc6978a4c26581ea7f993f90cc228 (patch) | |
tree | c773c537b3b145e06f1019cede5f3cdf9f5997ff /sc | |
parent | 8561d89fef49edf29c2675ec1a51f43f6eb86f97 (diff) |
limit WEBSERVICE to http[s] protocols
and like excel...
'For protocols that aren’t supported, such as ftp:// or file://, WEBSERVICE
returns the #VALUE! error value.'
Change-Id: I0e9c6fd3426fad56a199eafac48de9b0f23914b3
(cherry picked from commit c6c3ed3c750a3c71cb57909c60773fde2c43cd2a)
(cherry picked from commit defb648f718c3ea52c719313986a7188c6a6eafd)
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/core/tool/interpr7.cxx | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/sc/source/core/tool/interpr7.cxx b/sc/source/core/tool/interpr7.cxx index ce69848d6f99..66cc47d06606 100644 --- a/sc/source/core/tool/interpr7.cxx +++ b/sc/source/core/tool/interpr7.cxx @@ -11,6 +11,7 @@ #include <rtl/strbuf.hxx> #include <formula/errorcodes.hxx> #include <svtools/miscopt.hxx> +#include <tools/urlobj.hxx> #include <com/sun/star/ucb/XSimpleFileAccess3.hpp> #include <com/sun/star/ucb/SimpleFileAccess.hpp> @@ -158,6 +159,14 @@ void ScInterpreter::ScWebservice() return; } + INetURLObject aObj(aURI, INetProtocol::File); + INetProtocol eProtocol = aObj.GetProtocol(); + if (eProtocol != INetProtocol::Http && eProtocol != INetProtocol::Https) + { + PushError( FormulaError::NoValue ); + return; + } + uno::Reference< ucb::XSimpleFileAccess3 > xFileAccess( ucb::SimpleFileAccess::create( comphelper::getProcessComponentContext() ), uno::UNO_QUERY ); if(!xFileAccess.is()) { |