sfx2/source/view/lokhelper.cxx |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

New commits:
commit ba2d21197affa5678143dd3cb3a2003d57bb6e22
Author:     Szymon Kłos <szymon.k...@collabora.com>
AuthorDate: Mon Feb 13 13:05:26 2023 +0100
Commit:     Henry Castro <hcas...@collabora.com>
CommitDate: Mon Feb 13 13:01:13 2023 +0000

    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 <jenkinscollaboraoff...@gmail.com>
    Reviewed-by: Henry Castro <hcas...@collabora.com>

diff --git a/sfx2/source/view/lokhelper.cxx b/sfx2/source/view/lokhelper.cxx
index 9f34d31c5766..e61263acc8c6 100644
--- a/sfx2/source/view/lokhelper.cxx
+++ b/sfx2/source/view/lokhelper.cxx
@@ -578,8 +578,10 @@ void SfxLokHelper::notifyWindow(const SfxViewShell* 
pThisView,
     {
         if (!rItem.first.isEmpty() && !rItem.second.isEmpty())
         {
-            aPayload.append(", \"" + rItem.first + "\": \"" +
-                    rItem.second).append('"');
+            auto aFirst = rItem.first.replaceAll("\"", "\\\"");
+            auto aSecond = rItem.second.replaceAll("\"", "\\\"");
+            aPayload.append(", \"" + aFirst + "\": \"" +
+                    aSecond).append('"');
         }
     }
     aPayload.append('}');

Reply via email to