From 21ff4cdcadd4f62eaaa4d17f5b8b2e283ae7cca7 Mon Sep 17 00:00:00 2001 From: Amir Khan Date: Wed, 27 Nov 2024 08:33:11 -0500 Subject: [PATCH] Fix: iOS PsiphonTunnel returning null if file path contains spaces * Fixes +[NSURL URLWithString:] returning null if file path is not percent-encoded (containing space instead of %20). --- .../iOS/PsiphonTunnel/PsiphonTunnel/PsiphonTunnel.m | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/MobileLibrary/iOS/PsiphonTunnel/PsiphonTunnel/PsiphonTunnel.m b/MobileLibrary/iOS/PsiphonTunnel/PsiphonTunnel/PsiphonTunnel.m index 3dd35074c..40b3ec8b6 100644 --- a/MobileLibrary/iOS/PsiphonTunnel/PsiphonTunnel/PsiphonTunnel.m +++ b/MobileLibrary/iOS/PsiphonTunnel/PsiphonTunnel/PsiphonTunnel.m @@ -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