[Sandbox Configuration] Do more checks on test
When testing the path for whether it's in storage, run more tests to make sure we only care about valid paths, and a path that actually has a string. Signed-off-by: Christopher Snowhill <kode54@gmail.com>swiftingly
parent
3d8f470206
commit
cc46c5a5ee
|
@ -119,9 +119,14 @@
|
|||
- (BOOL)matchesPath:(NSURL *)url {
|
||||
id sandboxBrokerClass = NSClassFromString(@"SandboxBroker");
|
||||
for(NSDictionary *entry in [self arrangedObjects]) {
|
||||
NSURL *testPath = [NSURL fileURLWithPath:[entry objectForKey:@"path"]];
|
||||
if([sandboxBrokerClass isPath:url aSubdirectoryOf:testPath])
|
||||
return YES;
|
||||
if([[entry objectForKey:@"valid"] isEqualToString:NSLocalizedPrefString(@"ValidYes")]) {
|
||||
NSString *path = [entry objectForKey:@"path"];
|
||||
if(path && [path length]) {
|
||||
NSURL *testPath = [NSURL fileURLWithPath:[entry objectForKey:@"path"]];
|
||||
if([sandboxBrokerClass isPath:url aSubdirectoryOf:testPath])
|
||||
return YES;
|
||||
}
|
||||
}
|
||||
}
|
||||
return NO;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue