diff options
author | Tor Lillqvist <tml@collabora.com> | 2023-01-04 12:59:34 +0200 |
---|---|---|
committer | Tor Lillqvist <tml@iki.fi> | 2023-01-06 16:09:52 +0200 |
commit | 410270fd14dd911c0edbda421b773a1e3fa0a288 (patch) | |
tree | f7df2fcc6002b849d49e352f184e632f732fcf65 /gtk | |
parent | zotero: implement citation refresh (diff) | |
download | online-410270fd14dd911c0edbda421b773a1e3fa0a288.tar.gz online-410270fd14dd911c0edbda421b773a1e3fa0a288.zip |
Actually use the safer (escaped) string we construct
Also, no reason to append a null byte to it.
Don't know why this worked even when not escaping "dangerous"
characters. Does Webkit have a more relaxed lexical analyser?
Signed-off-by: Tor Lillqvist <tml@collabora.com>
Change-Id: Idfedcbf11a9ee565b954ba972e7e3bc9b804a122
Diffstat (limited to 'gtk')
-rw-r--r-- | gtk/mobile.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/gtk/mobile.cpp b/gtk/mobile.cpp index c27d973a66..c41e38e759 100644 --- a/gtk/mobile.cpp +++ b/gtk/mobile.cpp @@ -30,7 +30,7 @@ const char *user_name = "Dummy"; -const int SHOW_JS_MAXLEN = 70; +const int SHOW_JS_MAXLEN = 300; int coolwsd_server_socket_fd = -1; @@ -87,10 +87,9 @@ static void send2JS(const std::vector<char>& buffer) data.push_back(ubufp[i]); } } - data.push_back(0); js = "window.TheFakeWebSocket.onmessage({'data': '"; - js = js + std::string(buffer.data(), buffer.size()); + js = js + std::string(data.data(), data.size()); js = js + "'});"; } |