diff options
author | Rick Pasetto <rick@lindenlab.com> | 2009-11-10 12:29:20 -0800 |
---|---|---|
committer | Rick Pasetto <rick@lindenlab.com> | 2009-11-10 12:29:20 -0800 |
commit | 2420a4b90c964bcc2c928c4593652fdf81e0e20f (patch) | |
tree | 630cfffb754d87f4500fa2109dbdca9426eec517 /indra/llprimitive/llmediaentry.cpp | |
parent | 033d61ddb312080dc986803f6c1921cbd554c598 (diff) |
FIX DEV-41949: LLMediaEntry::setWhitelist() and LLMediaEntry::asLLSD() have a contract conflict
Review #32
This code will go into both server 1.32 branch and the viewer branch.
As proposed in DEV-41949, I've changed setWhitelist(const LLSD &whitelist) to clear the whitelist if the WHITELIST_KEY is not present in the passed-in 'whitelist'. I've also made sure that asLLSD() ensures that the WHITELIST_KEY is erased in the given LLSD.
Diffstat (limited to 'indra/llprimitive/llmediaentry.cpp')
-rw-r--r-- | indra/llprimitive/llmediaentry.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/indra/llprimitive/llmediaentry.cpp b/indra/llprimitive/llmediaentry.cpp index 701300163a..2fc1e5e60c 100644 --- a/indra/llprimitive/llmediaentry.cpp +++ b/indra/llprimitive/llmediaentry.cpp @@ -389,8 +389,12 @@ U32 LLMediaEntry::setWhiteList( const std::vector<std::string> &whitelist ) U32 LLMediaEntry::setWhiteList( const LLSD &whitelist ) { - // If whitelist is undef, this is a no-op. - if (whitelist.isUndefined()) return LSL_STATUS_OK; + // If whitelist is undef, the whitelist is cleared + if (whitelist.isUndefined()) + { + mWhiteList.clear(); + return LSL_STATUS_OK; + } // However, if the whitelist is an empty array, erase it. if (whitelist.isArray()) |