diff options
author | Szymon Kłos <szymon.klos@collabora.com> | 2023-02-13 13:05:26 +0100 |
---|---|---|
committer | Henry Castro <hcastro@collabora.com> | 2023-05-12 13:22:02 +0200 |
commit | 8abce26253f3ba6bf74ba419775bf2b4a2f23546 (patch) | |
tree | 9d61f7532140276db272096d9364a3f7a22999d8 /sfx2 | |
parent | d01f432d283631cf99766ccbb315238f013b79d1 (diff) |
lok: escape notifyWindow message
File properties dialog contains problematic characters.
In lok case and nl language it was constructing incorrect
message so boost JSON parser was throwing an exception
and dialog was not created correctly.
Change-Id: I7e81c9407fcbf57355c0890c9540ce1f828904e5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146900
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Henry Castro <hcastro@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150042
Tested-by: Szymon Kłos <szymon.klos@collabora.com>
Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150389
Tested-by: Jenkins
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/view/lokhelper.cxx | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sfx2/source/view/lokhelper.cxx b/sfx2/source/view/lokhelper.cxx index 6f7f9ee60dd2..22b5ccc10b34 100644 --- a/sfx2/source/view/lokhelper.cxx +++ b/sfx2/source/view/lokhelper.cxx @@ -579,8 +579,9 @@ void SfxLokHelper::notifyWindow(const SfxViewShell* pThisView, { if (!rItem.first.isEmpty() && !rItem.second.isEmpty()) { - aPayload.append(", \"" + rItem.first + "\": \"" + - rItem.second + "\""); + auto aFirst = rItem.first.replaceAll("\"", "\\\""); + auto aSecond = rItem.second.replaceAll("\"", "\\\""); + aPayload.append(", \"" + aFirst + "\": \"" + aSecond + "\""); } } aPayload.append('}'); |