We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8859637 commit 0e3cc42Copy full SHA for 0e3cc42
WebViewJavascriptBridge/Classes/WebViewJavascriptBridge.m
@@ -23,6 +23,9 @@ - (void)sendMessage:(NSString *)message {
23
}
24
25
- (void)_doSendMessage:(NSString *)message {
26
+ message = [message stringByReplacingOccurrencesOfString:@"\\n" withString:@"\\\\n"];
27
+ message = [message stringByReplacingOccurrencesOfString:@"'" withString:@"\\'"];
28
+ message = [message stringByReplacingOccurrencesOfString:@"\"" withString:@"\\\""];
29
[webView stringByEvaluatingJavaScriptFromString:[NSString stringWithFormat:@"WebViewJavascriptBridge._handleMessageFromObjC('%@');", message]];
30
31
0 commit comments