This repository was archived by the owner on Jul 23, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
This repository was archived by the owner on Jul 23, 2019. It is now read-only.
Questionable URL construction #34
Copy link
Copy link
Open
Description
From
Cat2Cat/Cat2Cat/VICatalogWalker.m
Lines 84 to 91 in 8dc941b
| //Since we're converting to an NSURL, use percent-escape encoding or spaces will crash. | |
| path = [path stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; | |
| //Make sure to skip hidden files | |
| NSArray *folderContents = [self.fileManager contentsOfDirectoryAtURL:[NSURL URLWithString:path] | |
| includingPropertiesForKeys:@[NSURLNameKey] | |
| options:NSDirectoryEnumerationSkipsHiddenFiles | |
| error:&folderError]; |
//Since we're converting to an NSURL, use percent-escape encoding or spaces will crash.
path = [path stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
//Make sure to skip hidden files
NSArray *folderContents = [self.fileManager contentsOfDirectoryAtURL:[NSURL URLWithString:path]
includingPropertiesForKeys:@[NSURLNameKey]
options:NSDirectoryEnumerationSkipsHiddenFiles
error:&folderError];This should probably be something like:
//Make sure to skip hidden files
NSArray *folderContents = [self.fileManager contentsOfDirectoryAtURL:[NSURL fileURLWithPath:path]
includingPropertiesForKeys:@[NSURLNameKey]
options:NSDirectoryEnumerationSkipsHiddenFiles
error:&folderError];(h/t @bryanluby)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels