Skip to content

Commit

Permalink
Fix: iOS PsiphonTunnel returning null if file path contains spaces
Browse files Browse the repository at this point in the history
* Fixes +[NSURL URLWithString:] returning null if file path is not
  percent-encoded (containing space instead of %20).
  • Loading branch information
adotkhan authored and rod-hynes committed Nov 27, 2024
1 parent a6c5cfa commit 8008912
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions MobileLibrary/iOS/PsiphonTunnel/PsiphonTunnel/PsiphonTunnel.m
Original file line number Diff line number Diff line change
Expand Up @@ -192,17 +192,20 @@ + (NSURL*)defaultDataRootDirectoryWithError:(NSError**)err {

// See comment in header
+ (NSURL*)homepageFilePath:(NSURL*)dataRootDirectory {
return [NSURL URLWithString:GoPsiHomepageFilePath(dataRootDirectory.path)];
return [NSURL fileURLWithPath:GoPsiHomepageFilePath(dataRootDirectory.path)
isDirectory:FALSE];
}

// See comment in header
+ (NSURL*)noticesFilePath:(NSURL*)dataRootDirectory {
return [NSURL URLWithString:GoPsiNoticesFilePath(dataRootDirectory.path)];
return [NSURL fileURLWithPath:GoPsiNoticesFilePath(dataRootDirectory.path)
isDirectory:FALSE];
}

// See comment in header
+ (NSURL*)olderNoticesFilePath:(NSURL*)dataRootDirectory {
return [NSURL URLWithString:GoPsiOldNoticesFilePath(dataRootDirectory.path)];
return [NSURL fileURLWithPath:GoPsiOldNoticesFilePath(dataRootDirectory.path)
isDirectory:FALSE];
}

// See comment in header
Expand Down

0 comments on commit 8008912

Please sign in to comment.