summaryrefslogtreecommitdiff
path: root/indra/newview/lltranslate.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/lltranslate.cpp')
-rw-r--r--indra/newview/lltranslate.cpp9
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);