diff options
author | Maxim Nikolenko <maximnproductengine@lindenlab.com> | 2023-08-07 20:17:18 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-07 20:17:18 +0300 |
commit | 177d7124904d84ce38102ba3255c5dccc6adb35b (patch) | |
tree | 838f76b1bc88f0b6a148ba4c28b58c1847dc3eee | |
parent | 724b6a8c64dab8bb3586b3273e51d7502ac44749 (diff) |
SL-20086 esсape the message text before sending
-rw-r--r-- | indra/newview/lltranslate.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/indra/newview/lltranslate.cpp b/indra/newview/lltranslate.cpp index 9344eeb573..6182c96597 100644 --- a/indra/newview/lltranslate.cpp +++ b/indra/newview/lltranslate.cpp @@ -725,7 +725,7 @@ bool LLAzureTranslationHandler::parseResponse( return false; } - translation = first["text"].asString(); + translation = LLURI::unescape(first["text"].asString()); return true; } @@ -825,8 +825,13 @@ LLSD LLAzureTranslationHandler::sendMessageAndSuspend(LLCoreHttpUtil::HttpCorout { LLCore::BufferArray::ptr_t rawbody(new LLCore::BufferArray); LLCore::BufferArrayStream outs(rawbody.get()); + + static const std::string allowed_chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz " + "0123456789" + "-._~"; + outs << "[{\"text\":\""; - outs << msg; + outs << LLURI::escape(msg, allowed_chars); outs << "\"}]"; return adapter->postRawAndSuspend(request, url, rawbody, options, headers); |