diff options
author | Rick Pasetto <rick@lindenlab.com> | 2009-12-16 18:56:01 -0800 |
---|---|---|
committer | Rick Pasetto <rick@lindenlab.com> | 2009-12-16 18:56:01 -0800 |
commit | 064c9be9aedf238530ccdc941861fd057580e5b1 (patch) | |
tree | 4b95e659d0d46541573ce97abb55c4257b248644 /indra/newview | |
parent | 66d9161729aef01889e2713bdd0fffca8f6d5466 (diff) |
Don't allow drag if the cap URL is empty or if the whitelist does not pass
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llviewerwindow.cpp | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 5d2ca331d6..e3de2891a1 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -827,9 +827,9 @@ BOOL LLViewerWindow::handleMiddleMouseDown(LLWindow *window, LLCoordGL pos, MAS LLWindowCallbacks::DragNDropResult LLViewerWindow::handleDragNDrop( LLWindow *window, LLCoordGL pos, MASK mask, LLWindowCallbacks::DragNDropAction action, std::string data) { LLWindowCallbacks::DragNDropResult result = LLWindowCallbacks::DND_NONE; + if (gSavedSettings.getBOOL("PrimMediaDragNDrop")) { - switch(action) { // Much of the handling for these two cases is the same. @@ -854,11 +854,11 @@ LLWindowCallbacks::DragNDropResult LLViewerWindow::handleDragNDrop( LLWindow *wi S32 object_face = pick_info.mObjectFace; std::string url = data; - llinfos << "### Object: picked at " << pos.mX << ", " << pos.mY << " - face = " << object_face << " - URL = " << url << llendl; + lldebugs << "Object: picked at " << pos.mX << ", " << pos.mY << " - face = " << object_face << " - URL = " << url << llendl; LLVOVolume *obj = dynamic_cast<LLVOVolume*>(static_cast<LLViewerObject*>(pick_info.getObject())); - if (obj && obj->permModify()) + if (obj && obj->permModify() && !obj->getRegion()->getCapability("ObjectMedia").empty()) { LLTextureEntry *te = obj->getTE(object_face); if (te) @@ -881,10 +881,14 @@ LLWindowCallbacks::DragNDropResult LLViewerWindow::handleDragNDrop( LLWindow *wi result = LLWindowCallbacks::DND_COPY; } else { - // just navigate to the URL - obj->getMediaImpl(object_face)->navigateTo(url); + // Check the whitelist + if (te->getMediaData()->checkCandidateUrl(url)) + { + // just navigate to the URL + obj->getMediaImpl(object_face)->navigateTo(url); - result = LLWindowCallbacks::DND_LINK; + result = LLWindowCallbacks::DND_LINK; + } } LLSelectMgr::getInstance()->unhighlightObjectOnly(mDragHoveredObject); mDragHoveredObject = NULL; |