diff options
author | Tofu Linden <tofu.linden@lindenlab.com> | 2010-09-06 12:45:45 +0100 |
---|---|---|
committer | Tofu Linden <tofu.linden@lindenlab.com> | 2010-09-06 12:45:45 +0100 |
commit | 0be40c91e6f2190b704a9100ac7157618de9cbdb (patch) | |
tree | 2fddca2f237b15932292bcd233da85bd8b8814b6 /indra | |
parent | 5ead04fb463544a5df4b2be24107ba31c608abe6 (diff) | |
parent | bdd1017d0d553bf0559eb9b59a9b6dbda1d5ca71 (diff) |
merge Ardy Lay's VWR-19499 / SNOW-652 fix.
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/llchatbar.cpp | 29 | ||||
-rw-r--r-- | indra/newview/llnearbychatbar.cpp | 32 |
2 files changed, 48 insertions, 13 deletions
diff --git a/indra/newview/llchatbar.cpp b/indra/newview/llchatbar.cpp index 967db21244..7d82ec3a71 100644 --- a/indra/newview/llchatbar.cpp +++ b/indra/newview/llchatbar.cpp @@ -673,11 +673,30 @@ public: bool handle(const LLSD& tokens, const LLSD& query_map, LLMediaCtrl* web) { - if (tokens.size() < 2) return false; - S32 channel = tokens[0].asInteger(); - std::string mesg = tokens[1].asString(); - send_chat_from_viewer(mesg, CHAT_TYPE_NORMAL, channel); - return true; + bool retval = false; + // Need at least 2 tokens to have a valid message. + if (tokens.size() < 2) + { + retval = false; + } + else + { + S32 channel = tokens[0].asInteger(); + // VWR-19499 Restrict function to chat channels greater than 0. + if ((channel > 0) && (channel < 2147483647)) + { + retval = true; + // Say mesg on channel + std::string mesg = tokens[1].asString(); + send_chat_from_viewer(mesg, CHAT_TYPE_NORMAL, channel); + } + else + { + retval = false; + // Tell us this is an unsupported SLurl. + } + } + return retval; } }; diff --git a/indra/newview/llnearbychatbar.cpp b/indra/newview/llnearbychatbar.cpp index 4f9845d704..43630c13fd 100644 --- a/indra/newview/llnearbychatbar.cpp +++ b/indra/newview/llnearbychatbar.cpp @@ -865,14 +865,30 @@ public: bool handle(const LLSD& tokens, const LLSD& query_map, LLMediaCtrl* web) { - if (tokens.size() < 2) return false; - S32 channel = tokens[0].asInteger(); - - // Send unescaped message, see EXT-6353. - std::string unescaped_mesg (LLURI::unescape(tokens[1].asString())); - - send_chat_from_viewer(unescaped_mesg, CHAT_TYPE_NORMAL, channel); - return true; + bool retval = false; + // Need at least 2 tokens to have a valid message. + if (tokens.size() < 2) + { + retval = false; + } + else + { + S32 channel = tokens[0].asInteger(); + // VWR-19499 Restrict function to chat channels greater than 0. + if ((channel > 0) && (channel < 2147483647)) + { + retval = true; + // Send unescaped message, see EXT-6353. + std::string unescaped_mesg (LLURI::unescape(tokens[1].asString())); + send_chat_from_viewer(unescaped_mesg, CHAT_TYPE_NORMAL, channel); + } + else + { + retval = false; + // Tell us this is an unsupported SLurl. + } + } + return retval; } }; |