Fix wxWebView::RunScript() with string containing backslashes

Escape backslashes in wxJSScriptWrapper to allow strings with
backslashes in them to work again -- this was broken while implementing
support for returning values from JavaScript to C++.

See https://github.com/wxWidgets/wxWidgets/pull/741
This commit is contained in:
Maarten Bent
2018-02-21 21:51:36 +01:00
committed by Vadim Zeitlin
parent dd2d62c703
commit 3d427a1af1
2 changed files with 4 additions and 1 deletions

View File

@@ -38,7 +38,7 @@ public:
// Adds one escape level if there is a single quote, double quotes or
// escape characters
wxRegEx escapeDoubleQuotes("(\\\\*)(['\"\n\r\v\t\b\f])");
wxRegEx escapeDoubleQuotes("(\\\\*)([\\'\"\n\r\v\t\b\f])");
escapeDoubleQuotes.Replace(&m_escapedCode,"\\1\\1\\\\\\2");
}