Skip to content

Commit

Permalink
Fixes url parsing bug -- reenables in-app auth flow
Browse files Browse the repository at this point in the history
Summary:
Introduced a bug in URL parsing with the frictionless fix, which
failed to recognize urls that begin the parameter section with #

Test Plan:
Whitebox test using hackbook to force the in-app auth flow, and
confirm that the new line enables parsing of the returned URL

Reviewers: yariv, caabernathy, mmarucheck, vijaye

Reviewed By: mmarucheck

Differential Revision: https://phabricator.fb.com/D425267
  • Loading branch information
onebit committed Mar 9, 2012
1 parent e10bdc1 commit b512d54
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/FBDialog.m
Expand Up @@ -566,7 +566,7 @@ - (NSString *) getStringFromUrl: (NSString*) url needle:(NSString *) needle {
if (start.location != 0) { if (start.location != 0) {
c = [url characterAtIndex:start.location - 1]; c = [url characterAtIndex:start.location - 1];
} }
if (c == '?' || c == '&') { if (c == '?' || c == '&' || c == '#') {
NSRange end = [[url substringFromIndex:start.location+start.length] rangeOfString:@"&"]; NSRange end = [[url substringFromIndex:start.location+start.length] rangeOfString:@"&"];
NSUInteger offset = start.location+start.length; NSUInteger offset = start.location+start.length;
str = end.location == NSNotFound ? str = end.location == NSNotFound ?
Expand Down

0 comments on commit b512d54

Please sign in to comment.