From 340a31b96a5750653e6e1645bfb241feb586ac9b Mon Sep 17 00:00:00 2001 From: Tom Carpel Date: Thu, 14 Sep 2017 19:38:19 -0700 Subject: [PATCH] Fix how the extension gets calculated when accounting for empty filenames --- .../Categories/NSString+BOXContentSDKAdditions.m | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/BoxContentSDK/BoxContentSDK/Categories/NSString+BOXContentSDKAdditions.m b/BoxContentSDK/BoxContentSDK/Categories/NSString+BOXContentSDKAdditions.m index 0c092bf3e..fd30a57d0 100644 --- a/BoxContentSDK/BoxContentSDK/Categories/NSString+BOXContentSDKAdditions.m +++ b/BoxContentSDK/BoxContentSDK/Categories/NSString+BOXContentSDKAdditions.m @@ -110,15 +110,10 @@ - (NSString *)box_stringByDeletingMultiplePathExtensionsIfNecessary - (NSString *)box_fileNameExtensionAccountingForEmptyName { - // Get the path extension from the file name. - NSString *string = [[self lastPathComponent] pathExtension]; - // pathExtension returns an empty string if there are no characters before the pathExtension (e.g ".jpg" or ".m4a") // Just simulating a correct name to correctly find the extension, since they are still valid files that can be previewed. - if (string.length == 0) { - NSString *tmp = [NSString stringWithFormat:@"tmp%@", self.lastPathComponent]; - string = [tmp box_pathExtensionAccountingForZippedPackages]; - } + NSString *tmp = [NSString stringWithFormat:@"tmp%@", self.lastPathComponent]; + NSString *string = [tmp box_pathExtensionAccountingForZippedPackages]; return string; }