diff options
| author | Rick Pasetto <rick@lindenlab.com> | 2010-01-08 12:18:21 -0800 | 
|---|---|---|
| committer | Rick Pasetto <rick@lindenlab.com> | 2010-01-08 12:18:21 -0800 | 
| commit | f5fd0729b6303933c1c67171eec1701fa4d8c55e (patch) | |
| tree | 1beafc1d4d86070480a047105cff43435d6a0092 | |
| parent | 6a1a93be1addb3cdb86fd163046a051344312cf2 (diff) | |
FIX EXT-4052: don't bounce back if url does not pass whitelist
http://codereview.lindenlab.com/265005/show
| -rw-r--r-- | indra/newview/llviewermedia.h | 2 | ||||
| -rw-r--r-- | indra/newview/llvovolume.cpp | 16 | 
2 files changed, 15 insertions, 3 deletions
| diff --git a/indra/newview/llviewermedia.h b/indra/newview/llviewermedia.h index 5e4dd8ff30..ad08846f7e 100644 --- a/indra/newview/llviewermedia.h +++ b/indra/newview/llviewermedia.h @@ -202,6 +202,7 @@ public:  	bool isMediaPaused();  	bool hasMedia() const;  	bool isMediaFailed() const { return mMediaSourceFailed; }; +	void setMediaFailed(bool val) { mMediaSourceFailed = val; }  	void resetPreviousMediaState();  	void setDisabled(bool disabled); @@ -311,6 +312,7 @@ public:  	void setNavState(EMediaNavState state);  	void cancelMimeTypeProbe(); +		  public:  	// a single media url with some data and an impl.  	LLPluginClassMedia* mMediaSource; 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);          } | 
