Skip to content

Commit 82da371

Browse files
authored
bug: fix url encoding for strings (#141)
* bug: fix url encoding for strings * remove test url
1 parent 94ecdca commit 82da371

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Leanplum-SDK/Classes/LPMessageTemplates.m

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,8 @@ - (void)defineActions
323323
withResponder:^BOOL(LPActionContext *context) {
324324
@try {
325325
dispatch_async(dispatch_get_main_queue(), ^{
326-
NSURL *url = [NSURL URLWithString:[context stringNamed:LPMT_ARG_URL]];
326+
NSString *encodedURLString = [[context stringNamed:LPMT_ARG_URL] stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLHostAllowedCharacterSet]];
327+
NSURL *url = [NSURL URLWithString: encodedURLString];
327328
if ([[UIApplication sharedApplication] respondsToSelector:@selector(openURL:options:completionHandler:)]) {
328329
[[UIApplication sharedApplication] openURL:url options:@{} completionHandler:nil];
329330
} else {

0 commit comments

Comments
 (0)