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 c730087 commit ce3a399Copy full SHA for ce3a399
ios/RCTWebViewBridge.m
@@ -87,8 +87,10 @@ - (void)sendToBridge:(NSString *)message
87
}
88
}());
89
);
90
+ // Escape singlequotes or messages containing ' will fail
91
+ NSString *quotedMessage = [message stringByReplacingOccurrencesOfString:@"'" withString:@"\\'"];
92
- NSString *command = [NSString stringWithFormat: format, message];
93
+ NSString *command = [NSString stringWithFormat: format, quotedMessage];
94
[_webView stringByEvaluatingJavaScriptFromString:command];
95
96
0 commit comments