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

New commits:
commit eb8e723225f3c63ff644ba840189874f295a1a62
Author:     Szymon Kłos <szymon.k...@collabora.com>
AuthorDate: Mon Feb 13 13:05:26 2023 +0100
Commit:     Szymon Kłos <szymon.k...@collabora.com>
CommitDate: Wed Apr 12 07:32:36 2023 +0200

    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>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150042
    Tested-by: Szymon Kłos <szymon.k...@collabora.com>
    Reviewed-by: Szymon Kłos <szymon.k...@collabora.com>

diff --git a/sfx2/source/view/lokhelper.cxx b/sfx2/source/view/lokhelper.cxx
index bc33ad942382..b66ad6d05b83 100644
--- a/sfx2/source/view/lokhelper.cxx
+++ b/sfx2/source/view/lokhelper.cxx
@@ -587,8 +587,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