Skip to content

Commit 2e35da6

Browse files
authored
Fix regex to parse callback URL & save access token
The callback URL was no longer being correctly parsed by the regex, possibly due to the fact that the callback URL from put.io might have changed at some point. Due to this, the access token is never saved and the put.io adder is stuck in a limbo waiting for authentication.
1 parent 468b6fd commit 2e35da6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

put.io adder/PutioHelper.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ - (void)checkForUpdates
340340
- (void)saveAccessToken:(NSString *)url
341341
{
342342
NSError *error = nil;
343-
NSString *pattern = @"^putio://callback#access_token=(.*)";
343+
NSString *pattern = @"^putio://callback\\?#access_token=(.*)";
344344
NSRegularExpression *regex = [NSRegularExpression regularExpressionWithPattern:pattern options:0 error:&error];
345345
NSArray *matches = [regex matchesInString:url options:0 range:NSMakeRange(0, [url length])];
346346

@@ -387,4 +387,4 @@ - (NSString*)transformedValue:(double)value
387387
return [str stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]];
388388
}
389389

390-
@end
390+
@end

0 commit comments

Comments
 (0)