mirror of
https://github.com/tappollo/react-native-safari-view.git
synced 2026-01-12 17:03:09 +08:00
- Check for escaped characters in the URL string from args, before constructing the URL
This commit is contained in:
committed by
Koen Punt
parent
ed6fe52bc2
commit
8d4b5f7e0b
@@ -39,7 +39,12 @@ RCT_EXPORT_METHOD(show:(NSDictionary *)args resolver:(RCTPromiseResolveBlock)res
|
||||
return;
|
||||
}
|
||||
|
||||
NSURL *url = [NSURL URLWithString:args[@"url"]];
|
||||
NSMutableString *tempStr = [NSMutableString stringWithString:args[@"url"]];
|
||||
[tempStr replaceOccurrencesOfString:@" " withString:@"+" options:NSCaseInsensitiveSearch range:NSMakeRange(0, [tempStr length])];
|
||||
[tempStr replaceOccurrencesOfString:@"%09%09" withString:@"" options:NSCaseInsensitiveSearch range:NSMakeRange(0, [tempStr length])];
|
||||
NSString *urlString = [[NSString stringWithFormat:@"%@",tempStr] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
|
||||
NSURL *url = [NSURL URLWithString: urlString];
|
||||
|
||||
BOOL readerMode = [args[@"readerMode"] boolValue];
|
||||
UIColor *tintColorString = args[@"tintColor"];
|
||||
UIColor *barTintColorString = args[@"barTintColor"];
|
||||
|
||||
Reference in New Issue
Block a user