diff options
author | Rick Pasetto <rick@lindenlab.com> | 2010-01-19 12:24:50 -0800 |
---|---|---|
committer | Rick Pasetto <rick@lindenlab.com> | 2010-01-19 12:24:50 -0800 |
commit | 72684c15f745df670a7372cadade2c890d699eda (patch) | |
tree | aa21c2e67ca23d2f3de2f8f76da8d025c1ab1586 /indra | |
parent | a8cc535f544bb9b9941e0c45276db12d9c8e885d (diff) |
FIX EXT-4172: encode all URLs navigated by the plugin API
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/llviewermedia.cpp | 19 | ||||
-rw-r--r-- | indra/newview/llviewermedia.h | 1 |
2 files changed, 19 insertions, 1 deletions
diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index ef596f9297..04d67fe750 100644 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -1246,7 +1246,24 @@ void LLViewerMediaImpl::loadURI() { if(mMediaSource) { - mMediaSource->loadURI( mMediaURL ); + // *HACK: we don't know if the URI coming in is properly escaped + // (the contract doesn't specify whether it is escaped or not. + // but LLQtWebKit expects it to be, so we do our best to encode + // special characters) + // The strings below were taken right from http://www.ietf.org/rfc/rfc1738.txt + // Note especially that '%' and '/' are there. + std::string uri = LLURI::escape(mMediaURL, + "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" + "0123456789" + "$-_.+" + "!*'()," + "{}|\\^~[]`" + "<>#%" + ";/?:@&=", + false); + llinfos << "Asking media source to load URI: " << uri << llendl; + + mMediaSource->loadURI( uri ); if(mPreviousMediaState == MEDIA_PLAYING) { diff --git a/indra/newview/llviewermedia.h b/indra/newview/llviewermedia.h index 668f3b563d..ff18ed605a 100644 --- a/indra/newview/llviewermedia.h +++ b/indra/newview/llviewermedia.h @@ -330,6 +330,7 @@ public: bool isNavigateSuspended() { return mNavigateSuspended; }; void cancelMimeTypeProbe(); + private: // a single media url with some data and an impl. LLPluginClassMedia* mMediaSource; |