[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,10 +119,15 @@
|
||||||
- (BOOL)matchesPath:(NSURL *)url {
|
- (BOOL)matchesPath:(NSURL *)url {
|
||||||
id sandboxBrokerClass = NSClassFromString(@"SandboxBroker");
|
id sandboxBrokerClass = NSClassFromString(@"SandboxBroker");
|
||||||
for(NSDictionary *entry in [self arrangedObjects]) {
|
for(NSDictionary *entry in [self arrangedObjects]) {
|
||||||
|
if([[entry objectForKey:@"valid"] isEqualToString:NSLocalizedPrefString(@"ValidYes")]) {
|
||||||
|
NSString *path = [entry objectForKey:@"path"];
|
||||||
|
if(path && [path length]) {
|
||||||
NSURL *testPath = [NSURL fileURLWithPath:[entry objectForKey:@"path"]];
|
NSURL *testPath = [NSURL fileURLWithPath:[entry objectForKey:@"path"]];
|
||||||
if([sandboxBrokerClass isPath:url aSubdirectoryOf:testPath])
|
if([sandboxBrokerClass isPath:url aSubdirectoryOf:testPath])
|
||||||
return YES;
|
return YES;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
return NO;
|
return NO;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue