Kaydet (Commit) a916fc0c authored tarafından Caolán McNamara's avatar Caolán McNamara Kaydeden (comit) Markus Mohrhard

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
Reviewed-on: https://gerrit.libreoffice.org/47776Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarMarkus Mohrhard <markus.mohrhard@googlemail.com>
üst 4ed5f5b2
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
#include <rtl/strbuf.hxx> #include <rtl/strbuf.hxx>
#include <formula/errorcodes.hxx> #include <formula/errorcodes.hxx>
#include <svtools/miscopt.hxx> #include <svtools/miscopt.hxx>
#include <tools/urlobj.hxx>
#include <com/sun/star/ucb/XSimpleFileAccess3.hpp> #include <com/sun/star/ucb/XSimpleFileAccess3.hpp>
#include <com/sun/star/ucb/SimpleFileAccess.hpp> #include <com/sun/star/ucb/SimpleFileAccess.hpp>
...@@ -247,6 +248,14 @@ void ScInterpreter::ScWebservice() ...@@ -247,6 +248,14 @@ void ScInterpreter::ScWebservice()
return; 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 ); uno::Reference< ucb::XSimpleFileAccess3 > xFileAccess( ucb::SimpleFileAccess::create( comphelper::getProcessComponentContext() ), uno::UNO_QUERY );
if(!xFileAccess.is()) if(!xFileAccess.is())
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment