Browse Source

Fix AdPlug fileprovider to handle URL fragments properly.

master
Christopher Snowhill 8 months ago
parent
commit
b5b4eaf99d
1 changed files with 7 additions and 1 deletions
  1. +7
    -1
      Plugins/AdPlug/AdPlug/fileprovider.mm

+ 7
- 1
Plugins/AdPlug/AdPlug/fileprovider.mm View File

@@ -94,7 +94,13 @@ binistream * CProvider_cog::open(std::string filename) const
if ( p_file == nil )
{
NSString * urlString = [NSString stringWithUTF8String:filename.c_str()];
NSURL * url = [NSURL URLWithString:[urlString stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
NSString * fragmentString = @"";
NSRange fragmentRange = [urlString rangeOfString:@"#" options:NSBackwardsSearch];
if (fragmentRange.location != NSNotFound) {
fragmentString = [urlString substringFromIndex:fragmentRange.location];
urlString = [urlString substringToIndex:fragmentRange.location];
}
NSURL * url = [NSURL URLWithString:[[urlString stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding] stringByAppendingString:fragmentString]];
id audioSourceClass = NSClassFromString(@"AudioSource");
p_file = [audioSourceClass audioSourceForURL:url];


Loading…
Cancel
Save