diff --git a/SignalMessaging/attachments/SharingThreadPickerViewController.m b/SignalMessaging/attachments/SharingThreadPickerViewController.m index 44e71d9cf..1edce5f64 100644 --- a/SignalMessaging/attachments/SharingThreadPickerViewController.m +++ b/SignalMessaging/attachments/SharingThreadPickerViewController.m @@ -138,7 +138,7 @@ typedef void (^SendMessageBlock)(SendCompletionBlock completion); OWSAssert(data.length < kOversizeTextMessageSizeThreshold); NSString *_Nullable messageText = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; DDLogVerbose(@"%@ messageTextForAttachment: %@", self.logTag, messageText); - return messageText; + return [messageText filterStringForDisplay]; } - (void)threadWasSelected:(TSThread *)thread diff --git a/SignalMessaging/profiles/OWSUserProfile.m b/SignalMessaging/profiles/OWSUserProfile.m index 7333246ce..5bcf35de0 100644 --- a/SignalMessaging/profiles/OWSUserProfile.m +++ b/SignalMessaging/profiles/OWSUserProfile.m @@ -37,6 +37,7 @@ NSString *const kLocalProfileUniqueId = @"kLocalProfileUniqueId"; @implementation OWSUserProfile @synthesize avatarUrlPath = _avatarUrlPath; +@synthesize profileName = _profileName; + (NSString *)collection { @@ -333,6 +334,22 @@ NSString *const kLocalProfileUniqueId = @"kLocalProfileUniqueId"; self.avatarFileName]; } +- (nullable NSString *)profileName +{ + @synchronized(self) + { + return _profileName.filterStringForDisplay; + } +} + +- (void)setProfileName:(nullable NSString *)profileName +{ + @synchronized(self) + { + _profileName = profileName.filterStringForDisplay; + } +} + @end NS_ASSUME_NONNULL_END diff --git a/SignalServiceKit/src/Util/DataSource.m b/SignalServiceKit/src/Util/DataSource.m index 9ea7130ce..c32bd7a3a 100755 --- a/SignalServiceKit/src/Util/DataSource.m +++ b/SignalServiceKit/src/Util/DataSource.m @@ -78,6 +78,11 @@ NS_ASSUME_NONNULL_BEGIN return [data ows_isValidImage]; } +- (void)setSourceFilename:(nullable NSString *)sourceFilename +{ + _sourceFilename = sourceFilename.filterStringForDisplay; +} + @end #pragma mark - diff --git a/SignalShareExtension/ShareViewController.swift b/SignalShareExtension/ShareViewController.swift index f93c47b41..a188e70ed 100644 --- a/SignalShareExtension/ShareViewController.swift +++ b/SignalShareExtension/ShareViewController.swift @@ -638,7 +638,7 @@ public class ShareViewController: UIViewController, ShareViewDelegate, SAEFailed fulfill((itemUrl: fileUrl, utiType: srcUtiType)) } else if let string = value as? String { Logger.debug("\(strongSelf.logTag) string provider: \(string)") - guard let data = string.data(using: String.Encoding.utf8) else { + guard let data = string.filterStringForDisplay().data(using: String.Encoding.utf8) else { let writeError = ShareViewControllerError.assertionError(description: "Error writing item data: \(String(describing: error))") reject(writeError) return