Highly Complete: Fix crash on paths containing URL escapes
In the event of local paths containing not just UTF-8 characters, but also un-decoded URL percent sequences, which will end up double encoded in the player, code which reverses percent encoding should later re-apply it. Apparently, this whole time, since the last code overhaul, the URL encoding was being stripped, then the file opener was converting these paths back into URLs without re-encoding, which didn't break until someone played an album in a folder containing a partially decoded UTF-8 sequence. Thanks, Zophar's Domain, and whoever ripped the Golden Sun GSF set for finding this bug! Signed-off-by: Christopher Snowhill <kode54@gmail.com>
This commit is contained in:
parent
9ed4e4e8d9
commit
8102731228
1 changed files with 1 additions and 0 deletions
|
@ -103,6 +103,7 @@ void *source_fopen(const char *path) {
|
|||
id<CogSource> source;
|
||||
if(![[psf_file_container instance] try_hint:[NSString stringWithUTF8String:path] source:&source]) {
|
||||
NSString *urlString = [NSString stringWithUTF8String:path];
|
||||
urlString = [urlString stringByAddingPercentEncodingWithAllowedCharacters:NSCharacterSet.URLFragmentAllowedCharacterSet];
|
||||
NSURL *url = [NSURL URLWithDataRepresentation:[urlString dataUsingEncoding:NSUTF8StringEncoding] relativeToURL:nil];
|
||||
|
||||
id audioSourceClass = NSClassFromString(@"AudioSource");
|
||||
|
|
Loading…
Reference in a new issue