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 d446ef1 commit 5072390Copy full SHA for 5072390
ios/RCTWebViewBridge.m
@@ -97,8 +97,11 @@ - (void)sendToBridge:(NSString *)message
97
}
98
}());
99
);
100
+
101
+ // Escape singlequotes or messages containing ' will fail
102
+ NSString *quotedMessage = [message stringByReplacingOccurrencesOfString:@"'" withString:@"\\'"];
103
- NSString *command = [NSString stringWithFormat: format, message];
104
+ NSString *command = [NSString stringWithFormat: format, quotedMessage];
105
[_webView stringByEvaluatingJavaScriptFromString:command];
106
107
0 commit comments