From 40e66bc4b49cce98bf3cb711ece8de9d5393b2ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hans=20Kn=C3=B6chel?= Date: Sun, 17 Apr 2022 18:40:56 +0200 Subject: [PATCH] fix(ios): fix encoding for some URLs --- ios/Classes/TiWebdialogModule.m | 4 +++- ios/Classes/TiWebdialogModuleAssets.m | 4 +++- ios/manifest | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/ios/Classes/TiWebdialogModule.m b/ios/Classes/TiWebdialogModule.m index 3e2c206..3cf4787 100644 --- a/ios/Classes/TiWebdialogModule.m +++ b/ios/Classes/TiWebdialogModule.m @@ -62,7 +62,9 @@ - (void)safariViewControllerDidFinish:(SFSafariViewController *)controller - (SFSafariViewController *)safariController:(NSString *)url withEntersReaderIfAvailable:(BOOL)entersReaderIfAvailable andBarCollapsingEnabled:(BOOL)barCollapsingEnabled { if (_safariController == nil) { - NSURL *safariURL = [NSURL URLWithString:[url stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding]]; + NSString *encodedURL = [url stringByAddingPercentEncodingWithAllowedCharacters:NSCharacterSet.URLQueryAllowedCharacterSet]; + NSURL *safariURL = [NSURL URLWithString:encodedURL]; + if (@available(iOS 11.0, *)) { SFSafariViewControllerConfiguration *config = [[SFSafariViewControllerConfiguration alloc] init]; config.entersReaderIfAvailable = entersReaderIfAvailable; diff --git a/ios/Classes/TiWebdialogModuleAssets.m b/ios/Classes/TiWebdialogModuleAssets.m index b1db404..8f9ccb4 100644 --- a/ios/Classes/TiWebdialogModuleAssets.m +++ b/ios/Classes/TiWebdialogModuleAssets.m @@ -3,18 +3,20 @@ */ #import "TiWebdialogModuleAssets.h" -extern NSData *filterDataInRange(NSData *thedata, NSRange range); +extern NSData* filterDataInRange(NSData* thedata, NSRange range); @implementation TiWebdialogModuleAssets - (NSData *)moduleAsset { + return nil; } - (NSData *)resolveModuleAsset:(NSString *)path { + return nil; } diff --git a/ios/manifest b/ios/manifest index 8a9b8e4..9e03ce2 100644 --- a/ios/manifest +++ b/ios/manifest @@ -2,7 +2,7 @@ # this is your module manifest and used by Titanium # during compilation, packaging, distribution, etc. # -version: 3.0.1 +version: 3.0.2 apiversion: 2 architectures: armv7 arm64 i386 x86_64 description: titanium-web-dialog