Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions DeepLinkKit.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -738,6 +738,7 @@
isa = PBXProject;
attributes = {
CLASSPREFIX = DPL;
LastSwiftUpdateCheck = 0700;
LastUpgradeCheck = 0610;
ORGANIZATIONNAME = "Button, Inc.";
TargetAttributes = {
Expand Down
9 changes: 9 additions & 0 deletions DeepLinkKit/Categories/NSString+DPLQuery.m
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down
1 change: 0 additions & 1 deletion Podfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
xcodeproj 'DeepLinkKit.xcodeproj', 'Test' => :debug
plugin 'slather'


target 'SenderDemo', :exclusive => true do
pod 'DeepLinkKit', :path => '.'
end
Expand Down
4 changes: 2 additions & 2 deletions Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 6 additions & 0 deletions Tests/Categories/NSString_DPLQuerySpec.m
Original file line number Diff line number Diff line change
Expand Up @@ -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