viewer#2972 Fix viewer stripping quotes off folder names

master
Andrey Kleshchev 2024-10-29 23:02:46 +02:00 committed by Andrey Kleshchev
parent 1a79095173
commit a2c8661636
3 changed files with 26 additions and 1 deletions

View File

@ -3256,6 +3256,27 @@ std::string LLXMLNode::getTextContents() const
return msg;
}
std::string LLXMLNode::getXMLRPCTextContents() const
{
std::string msg;
std::string::size_type start = mValue.find_first_not_of(" \t\n");
if (start != mValue.npos)
{
std::string::size_type end = mValue.find_last_not_of(" \t\n");
if (end != mValue.npos)
{
msg = mValue.substr(start, end + 1 - start);
}
else
{
msg = mValue.substr(start);
}
}
// Convert any internal CR to LF
msg = utf8str_removeCRLF(msg);
return msg;
}
void LLXMLNode::setLineNumber(S32 line_number)
{
mLineNumber = line_number;
@ -3365,7 +3386,7 @@ bool LLXMLNode::fromXMLRPCValue(LLSD& target)
if (childp->hasName("string"))
{
target.assign(LLStringFn::xml_decode(childp->getTextContents()));
target.assign(LLStringFn::xml_decode(childp->getXMLRPCTextContents()));
return true;
}

View File

@ -295,6 +295,7 @@ protected:
bool removeChild(LLXMLNode* child);
bool isFullyDefault();
std::string getXMLRPCTextContents() const;
bool parseXmlRpcArrayValue(LLSD& target);
bool parseXmlRpcStructValue(LLSD& target);

View File

@ -313,6 +313,8 @@ bool LLXMLRPCTransaction::Impl::process()
if (mHasResponse && !mResponseParsed)
{
LLXMLNodePtr root;
bool strip_escaped_strings = LLXMLNode::sStripEscapedStrings;
LLXMLNode::sStripEscapedStrings = false;
if (!LLXMLNode::parseBuffer(mResponseText.data(), mResponseText.size(),
root, nullptr))
{
@ -329,6 +331,7 @@ bool LLXMLRPCTransaction::Impl::process()
LL_WARNS() << "XMLRPC response parsing failed; request URI: "
<< mURI << LL_ENDL;
}
LLXMLNode::sStripEscapedStrings = strip_escaped_strings;
mResponseParsed = true;
}