diff options
author | Oliver Bolte <obo@openoffice.org> | 2004-11-17 12:40:27 +0000 |
---|---|---|
committer | Oliver Bolte <obo@openoffice.org> | 2004-11-17 12:40:27 +0000 |
commit | db5211d6a65a95fda42323d5499d233975e04c5d (patch) | |
tree | 01e12abbc7d9f3191fd763a34bf5d2789fe89831 /comphelper | |
parent | db64487bf5fa5d8895716c9cc3dea9a60b0b25c5 (diff) |
INTEGRATION: CWS fwkbugfix03 (1.2.62); FILE MERGED
2004/09/10 10:07:22 as 1.2.62.1: #i34054# normalize URL before using
Diffstat (limited to 'comphelper')
-rw-r--r-- | comphelper/source/misc/mediadescriptor.cxx | 28 |
1 files changed, 25 insertions, 3 deletions
diff --git a/comphelper/source/misc/mediadescriptor.cxx b/comphelper/source/misc/mediadescriptor.cxx index 73a8acebb145..5f98f968146a 100644 --- a/comphelper/source/misc/mediadescriptor.cxx +++ b/comphelper/source/misc/mediadescriptor.cxx @@ -2,9 +2,9 @@ * * $RCSfile: mediadescriptor.cxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: pjunck $ $Date: 2004-11-03 08:12:05 $ + * last change: $Author: obo $ $Date: 2004-11-17 13:40:27 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -85,6 +85,10 @@ #include <com/sun/star/lang/XMultiServiceFactory.hpp> #endif +#ifndef __COM_SUN_STAR_UTIL_XURLTRANSFORMER_HPP__ +#include <com/sun/star/util/XURLTransformer.hpp> +#endif + #ifndef __COM_SUN_STAR_UCB_INTERACTIVEIOEXCEPTION_HPP__ #include <com/sun/star/ucb/InteractiveIOException.hpp> #endif @@ -449,7 +453,9 @@ sal_Bool MediaDescriptor::addInputStream() ::rtl::OUString::createFromAscii("Found no URL."), css::uno::Reference< css::uno::XInterface >()); - return impl_openStreamWithURL(sURL); + // Parse URL! Only the main part has to be used further. E.g. a jumpmark can make trouble + ::rtl::OUString sNormalizedURL = impl_normalizeURL(sURL); + return impl_openStreamWithURL(sNormalizedURL); } #if OSL_DEBUG_LEVEL>0 catch(const css::uno::Exception& ex) @@ -717,5 +723,21 @@ sal_Bool MediaDescriptor::impl_openStreamWithURL(const ::rtl::OUString& sURL) return xInputStream.is(); } +/*----------------------------------------------- + 10.09.2004 10:51 +-----------------------------------------------*/ +::rtl::OUString MediaDescriptor::impl_normalizeURL(const ::rtl::OUString& sURL) +{ + css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR = ::comphelper::getProcessServiceFactory(); + css::uno::Reference< css::util::XURLTransformer > xParser( + xSMGR->createInstance(::rtl::OUString::createFromAscii("com.sun.star.util.URLTransformer")), + css::uno::UNO_QUERY_THROW); + + css::util::URL aURL; + aURL.Complete = sURL; + xParser->parseStrict(aURL); + return aURL.Main; +} + } // namespace comphelper |