Skip to content

Commit

Permalink
fix bug of ? if query params
Browse files Browse the repository at this point in the history
  • Loading branch information
smhjsw committed Jan 26, 2015
1 parent 6f09ced commit 26ad79c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions HHRouter/HHRouter.m
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,9 @@ - (NSDictionary*)paramsInRoute:(NSString*)route
}

// Extract Params From Query.
NSArray* pathInfo = [route componentsSeparatedByString:@"?"];
if (pathInfo.count > 1) {
NSString* paramsString = [pathInfo objectAtIndex:1];
NSRange firstRange = [route rangeOfString:@"?"];
if (firstRange.location != NSNotFound && route.length > firstRange.location + firstRange.length) {
NSString* paramsString = [route substringFromIndex:firstRange.location + firstRange.length];
NSArray* paramStringArr = [paramsString componentsSeparatedByString:@"&"];
for (NSString* paramString in paramStringArr) {
NSArray* paramArr = [paramString componentsSeparatedByString:@"="];
Expand All @@ -138,6 +138,7 @@ - (NSDictionary*)paramsInRoute:(NSString*)route
}
}
}

Class class = subRoutes[@"_"];
if (class_isMetaClass(object_getClass(class))) {
if ([class isSubclassOfClass:[UIViewController class]]) {
Expand Down

0 comments on commit 26ad79c

Please sign in to comment.