From f5fd0729b6303933c1c67171eec1701fa4d8c55e Mon Sep 17 00:00:00 2001 From: Rick Pasetto Date: Fri, 8 Jan 2010 12:18:21 -0800 Subject: FIX EXT-4052: don't bounce back if url does not pass whitelist http://codereview.lindenlab.com/265005/show --- indra/newview/llvovolume.cpp | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'indra/newview/llvovolume.cpp') diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 55609621b3..310a4803f8 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -1852,12 +1852,22 @@ void LLVOVolume::mediaNavigateBounceBack(U8 texture_index) if (mep && impl) { std::string url = mep->getCurrentURL(); - if (url.empty()) + // If the url we're trying to "bounce back" to is either empty or not + // allowed by the whitelist, try the home url. If *that* doesn't work, + // go to about:blank + if (url.empty() || !mep->checkCandidateUrl(url)) { url = mep->getHomeURL(); } - if (! url.empty()) - { + if (url.empty() || !mep->checkCandidateUrl(url)) + { + // The url to navigate back to is not good, and we have nowhere else + // to go. + LL_WARNS("MediaOnAPrim") << "FAILED to bounce back URL \"" << url << "\" -- unloading impl" << LL_ENDL; + impl->setMediaFailed(true); + } + else { + // Okay, navigate now LL_INFOS("MediaOnAPrim") << "bouncing back to URL: " << url << LL_ENDL; impl->navigateTo(url, "", false, true); } -- cgit v1.3 From d33b72c318a7676ae7212975965befc728c92c8c Mon Sep 17 00:00:00 2001 From: Rick Pasetto Date: Fri, 8 Jan 2010 12:25:10 -0800 Subject: code review feedback: fixed comment --- indra/newview/llvovolume.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llvovolume.cpp') diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 310a4803f8..d23bcf9006 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -1854,7 +1854,7 @@ void LLVOVolume::mediaNavigateBounceBack(U8 texture_index) std::string url = mep->getCurrentURL(); // If the url we're trying to "bounce back" to is either empty or not // allowed by the whitelist, try the home url. If *that* doesn't work, - // go to about:blank + // set the media as failed and unload it if (url.empty() || !mep->checkCandidateUrl(url)) { url = mep->getHomeURL(); -- cgit v1.3