diff --git a/DeepLinkKit.xcodeproj/project.pbxproj b/DeepLinkKit.xcodeproj/project.pbxproj index d88bffd..14b91bb 100644 --- a/DeepLinkKit.xcodeproj/project.pbxproj +++ b/DeepLinkKit.xcodeproj/project.pbxproj @@ -738,6 +738,7 @@ isa = PBXProject; attributes = { CLASSPREFIX = DPL; + LastSwiftUpdateCheck = 0700; LastUpgradeCheck = 0610; ORGANIZATIONNAME = "Button, Inc."; TargetAttributes = { diff --git a/DeepLinkKit/Categories/NSString+DPLQuery.m b/DeepLinkKit/Categories/NSString+DPLQuery.m index 47b2024..f9ba29a 100644 --- a/DeepLinkKit/Categories/NSString+DPLQuery.m +++ b/DeepLinkKit/Categories/NSString+DPLQuery.m @@ -22,6 +22,15 @@ - (NSDictionary *)DPL_parametersFromQueryString { if ([pairs count] == 2) { NSString *key = [pairs[0] DPL_stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; NSString *value = [pairs[1] DPL_stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; + if (paramsDict[key]) { + if ([paramsDict[key] isKindOfClass:[NSArray class]]) { + [paramsDict[key] addObject:value]; + } + else { + paramsDict[key] = [NSMutableArray arrayWithObjects:paramsDict[key], value, nil]; + } + continue; + } paramsDict[key] = value; } } diff --git a/Podfile b/Podfile index e02baaf..9da1b7d 100644 --- a/Podfile +++ b/Podfile @@ -1,7 +1,6 @@ xcodeproj 'DeepLinkKit.xcodeproj', 'Test' => :debug plugin 'slather' - target 'SenderDemo', :exclusive => true do pod 'DeepLinkKit', :path => '.' end diff --git a/Podfile.lock b/Podfile.lock index ad11872..8ae31a9 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -19,10 +19,10 @@ EXTERNAL SOURCES: :path: . SPEC CHECKSUMS: - DeepLinkKit: 3979713c8a0b6bd3259fb7917e572acf56645a35 + DeepLinkKit: 83cba3b73a997fffa9cf5ddda2bcba8bbed0788a Expecta: 32604574add2c46a36f8d2f716b6c5736eb75024 KIF: a94bffe9c97e449e44f8fa481c53243d21309e1e OCMock: a10ea9f0a6e921651f96f78b6faee95ebc813b92 Specta: 9cec98310dca411f7c7ffd6943552b501622abfe -COCOAPODS: 0.37.1 +COCOAPODS: 0.38.2 diff --git a/Tests/Categories/NSString_DPLQuerySpec.m b/Tests/Categories/NSString_DPLQuerySpec.m index 653e39e..6a184ab 100644 --- a/Tests/Categories/NSString_DPLQuerySpec.m +++ b/Tests/Categories/NSString_DPLQuerySpec.m @@ -75,6 +75,12 @@ expect(params[@"one"]).to.equal(@"a one"); expect(params[@"two"]).to.equal(@"http://www.example.com?foo=bar"); }); + + it(@"should decode query parameters into a dictionary with an array of values", ^{ + NSString *query = @"numbers%5B%5D=1&numbers%5B%5D=2&numbers%5B%5D=3"; + NSDictionary *params = [query DPL_parametersFromQueryString]; + expect(params[@"numbers[]"]).to.equal(@[@"1", @"2", @"3"]); + }); }); SpecEnd