Skip to content
This repository has been archived by the owner on Aug 16, 2019. It is now read-only.

Commit

Permalink
Merge branch 'master' of github.com:sprhawk/ytoolkit
Browse files Browse the repository at this point in the history
  • Loading branch information
sprhawk committed Feb 9, 2012
2 parents 1af2d65 + 31e1f4c commit 0d25f24
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions ycocoaadditions/code/NSString+YHTTPURLString.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,5 @@
//requestURI is not in Unit Test
- (NSString *)requestURI NOTTESTED;

- (NSArray *)emailParts;
@end
11 changes: 11 additions & 0 deletions ycocoaadditions/code/NSString+YHTTPURLString.m
Original file line number Diff line number Diff line change
Expand Up @@ -410,4 +410,15 @@ - (NSString *)requestURI {
return [NSString stringWithFormat:@"%@%@%@", absolutePath, queryCompoent?queryCompoent:@"", fragmentCompoent?fragmentCompoent:@""];
}

- (NSArray *)emailParts
{
NSArray * emailParts = [self componentsSeparatedByString:@"@"];
if (2 != [emailParts count]) {
return nil;
}

// may be user@anydomain , will not test the number of the parts of the domain.
return emailParts;
}

@end
3 changes: 3 additions & 0 deletions yoauth/code/oauthv2/NSError+YOAuthv2.m
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ + (NSError *)errorByCheckingOAuthv2RedirectURIParameters:(NSDictionary *)paramet
__YToolkitBundle,
errorType);
NSMutableDictionary * userInfo = [NSMutableDictionary dictionaryWithCapacity:3];
if (nil == errorName) {
errorName = @"Unknown";
}
[userInfo setObject:errorName forKey:NSLocalizedDescriptionKey];
[userInfo addEntriesFromDictionary:parameters];
return [[self class] errorWithDomain:YOAuthv2ErrorDomain
Expand Down

0 comments on commit 0d25f24

Please sign in to comment.