wsd: do not decode already decoded fields

The different attributes of a document/user
are decoded when the kit receives them.
Decoding them a second time is usually harmless,
unless, that is, they contain '%'.

After the first decoding the '%' character might
not be escaping anything valid (depending on what
follows it). So a second attempt at decoding
might very well fail and throw, since the escape
code is invalid.

Change-Id: I73d56ce995b0237140a54b6c06bd36bde8b387bd
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
This commit is contained in:
Ashod Nakashian 2020-12-03 21:36:14 -05:00 committed by Andras Timar
parent d8bda129d7
commit cf965fe4e3

View file

@ -1402,9 +1402,8 @@ private:
// Append name of the user, if any, who opened the document to rendering options
if (!userName.empty())
{
std::string decodedUserName;
URI::decode(userName, decodedUserName);
renderOptsObj->set(".uno:Author", makePropertyValue("string", decodedUserName));
// userName must be decoded already.
renderOptsObj->set(".uno:Author", makePropertyValue("string", userName));
}
if (!spellOnline.empty())