From 1262ef98997061340178c32878851b48116259f9 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Wed, 10 Jan 2018 14:27:35 +0000 Subject: limit WEBSERVICE to http[s] protocols MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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) --- sc/source/core/tool/interpr7.cxx | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/sc/source/core/tool/interpr7.cxx b/sc/source/core/tool/interpr7.cxx index 67e1039d82ee..0a2f66459b44 100644 --- a/sc/source/core/tool/interpr7.cxx +++ b/sc/source/core/tool/interpr7.cxx @@ -11,6 +11,7 @@ #include #include #include +#include #include #include @@ -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()) { -- cgit