From 0cc845d2cae407216d99f7558ade8d4eed4a0e46 Mon Sep 17 00:00:00 2001 From: neilbergman Date: Thu, 12 Mar 2015 18:27:17 -0400 Subject: [PATCH] Update ChildBrowserViewController.m --- src/ios/ChildBrowserViewController.m | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) 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