diff --git a/src/ios/ChildBrowserViewController.m b/src/ios/ChildBrowserViewController.m index e6cd29f..65b3e4f 100644 --- a/src/ios/ChildBrowserViewController.m +++ b/src/ios/ChildBrowserViewController.m @@ -176,9 +176,14 @@ - (void)loadURL:(NSString*)url self.imageURL = url; self.isImage = YES; NSString* htmlText = @""; - htmlText = [ htmlText stringByReplacingOccurrencesOfString:@"IMGSRC" withString:url ]; - - [webView loadHTMLString:htmlText baseURL:[NSURL URLWithString:@""]]; + + NSString* encodedUrl = [url stringByReplacingOccurrencesOfString:@"'" withString:@"'"]; + encodedUrl = [encodedUrl stringByReplacingOccurrencesOfString:@"\"" withString:@"""]; + encodedUrl = [encodedUrl stringByReplacingOccurrencesOfString:@"<" withString:@"<"]; + encodedUrl = [encodedUrl stringByReplacingOccurrencesOfString:@">" withString:@">"]; + htmlText = [ htmlText stringByReplacingOccurrencesOfString:@"IMGSRC" withString:encodedUrl]; + + [webView loadHTMLString:htmlText baseURL:[NSURL URLWithString:@"about:blank"]]; } else