[Sandbox] Fix URL fragment removal function
This should be deleting from the #, including the #. Signed-off-by: Christopher Snowhill <kode54@gmail.com>lastfm
parent
14a1157508
commit
ad7574be59
|
@ -107,17 +107,12 @@ static SandboxBroker *kSharedSandboxBroker = nil;
|
|||
|
||||
NSString *s = [url path];
|
||||
|
||||
NSString *lastComponent = [url fragment];
|
||||
|
||||
if(lastComponent) {
|
||||
lastComponent = @"#";
|
||||
// Find that last component in the string from the end to make sure
|
||||
// to get the last one
|
||||
NSRange fragmentRange = [s rangeOfString:lastComponent
|
||||
options:NSBackwardsSearch];
|
||||
NSRange fragmentRange = [s rangeOfString:@"#"
|
||||
options:NSBackwardsSearch];
|
||||
|
||||
if(fragmentRange.location != NSNotFound) {
|
||||
// Chop the fragment.
|
||||
NSString *newURLString = [s substringToIndex:fragmentRange.location + fragmentRange.length];
|
||||
NSString *newURLString = [s substringToIndex:fragmentRange.location];
|
||||
|
||||
return [NSURL fileURLWithPath:newURLString];
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue