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