Skip to content

Commit

Permalink
feat(ios): replace deprecated properties (apache#631)
Browse files Browse the repository at this point in the history
  • Loading branch information
u01jmg3 committed Aug 4, 2024
1 parent 03a4f4c commit 3b23c47
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/ios/CDVFile.m
Original file line number Diff line number Diff line change
Expand Up @@ -586,8 +586,8 @@ - (void)resolveLocalFileSystemURI:(CDVInvokedUrlCommand*)command
//encode path with percent escapes
-(NSString *)encodePath:(NSString *)path
{
NSString *decodedPath = [path stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; //decode incase it's already encoded to avoid encoding twice
return [decodedPath stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
NSString *decodedPath = [path stringByRemovingPercentEncoding:NSUTF8StringEncoding]; //decode incase it's already encoded to avoid encoding twice
return [decodedPath stringByAddingPercentEncodingWithAllowedCharacters:NSUTF8StringEncoding];
}


Expand Down
2 changes: 1 addition & 1 deletion src/ios/CDVLocalFilesystem.m
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ - (NSString *)filesystemPathForURL:(CDVFilesystemURL *)url
- (CDVFilesystemURL *)URLforFullPath:(NSString *)fullPath
{
if (fullPath) {
NSString* escapedPath = [fullPath stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
NSString* escapedPath = [fullPath stringByAddingPercentEncodingWithAllowedCharacters:NSUTF8StringEncoding];
if ([fullPath hasPrefix:@"/"]) {
return [CDVFilesystemURL fileSystemURLWithString:[NSString stringWithFormat:@"%@://localhost/%@%@", kCDVFilesystemURLPrefix, self.name, escapedPath]];
}
Expand Down

0 comments on commit 3b23c47

Please sign in to comment.