Fix warning from using -stringByAddingPercentEscapesUsingEncoding:

This commit is contained in:
Zorg committed 2021-05-24 00:41:46 -07:00
1 parent d22ef79d9e
commit f8ef9608dc
1 file changed
+3 -4
+3 -4
View File
@@ -769,10 +769,9 @@ NSString *const SUUpdaterAppcastNotificationKey = @"SUUpdaterAppCastNotification
}
static NSString *escapeURLComponent(NSString *str) {
return [[[[str stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]
stringByReplacingOccurrencesOfString:@"=" withString:@"%3d"]
stringByReplacingOccurrencesOfString:@"&" withString:@"%26"]
stringByReplacingOccurrencesOfString:@"+" withString:@"%2b"];
NSString *escapedString = [str stringByAddingPercentEncodingWithAllowedCharacters:NSCharacterSet.URLQueryAllowedCharacterSet];
return [[[escapedString stringByReplacingOccurrencesOfString:@"=" withString:@"%3d"] stringByReplacingOccurrencesOfString:@"&" withString:@"%26"] stringByReplacingOccurrencesOfString:@"+" withString:@"%2b"];
}
// Precondition: The feed URL should be valid