From 5e62f1852a9020a9c53a9af2ad50964aac6f9f1e Mon Sep 17 00:00:00 2001 From: Abhi Beckert Date: Fri, 22 Apr 2016 14:09:05 +1000 Subject: #2482 decode percent escaped characters in handleEventWithURL. --- Source/SPAppController.m | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'Source') diff --git a/Source/SPAppController.m b/Source/SPAppController.m index 4f985133..458c62f9 100644 --- a/Source/SPAppController.m +++ b/Source/SPAppController.m @@ -813,7 +813,14 @@ pathComponents = [[[url absoluteString] substringToIndex:[[url absoluteString] length]-1] pathComponents]; else pathComponents = [[url absoluteString] pathComponents]; - + + // remove percent encoding + NSMutableArray *decodedPathComponents = [NSMutableArray arrayWithCapacity:pathComponents.count]; + for (NSString *component in pathComponents) { + [decodedPathComponents addObject:component.stringByRemovingPercentEncoding]; + } + pathComponents = decodedPathComponents.copy; + if([pathComponents count] > 2) parameter = [pathComponents subarrayWithRange:NSMakeRange(2, [pathComponents count]-2)]; else -- cgit v1.2.3