diff --git a/Podfile.lock b/Podfile.lock index 3f3dbb4e7..a4c414788 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -133,7 +133,7 @@ CHECKOUT OPTIONS: :commit: 23a5d1b67afc4dd028198202e25fd2e06ce396d7 :git: https://github.com/WhisperSystems/SignalProtocolKit.git SignalServiceKit: - :commit: 1fd7627daf713521e5ea8f20e266873d41e8c488 + :commit: 63cc0328b5523b53216285e0c754d0500b3ec344 :git: https://github.com/WhisperSystems/SignalServiceKit.git SocketRocket: :commit: 877ac7438be3ad0b45ef5ca3969574e4b97112bf diff --git a/Signal/src/util/OWSScrubbingLogFormatter.m b/Signal/src/util/OWSScrubbingLogFormatter.m index 3a645b2db..3a66f2ccb 100644 --- a/Signal/src/util/OWSScrubbingLogFormatter.m +++ b/Signal/src/util/OWSScrubbingLogFormatter.m @@ -1,5 +1,6 @@ -// Created by Michael Kirk on 9/27/16. -// Copyright © 2016 Open Whisper Systems. All rights reserved. +// +// Copyright (c) 2017 Open Whisper Systems. All rights reserved. +// #import "OWSScrubbingLogFormatter.h" @@ -17,7 +18,7 @@ NS_ASSUME_NONNULL_BEGIN NSString *filteredString = [phoneRegex stringByReplacingMatchesInString:string options:0 range:NSMakeRange(0, [string length]) - withTemplate:@"[ REDACTED_PHONE_NUMBER ]"]; + withTemplate:@"[ REDACTED_PHONE_NUMBER:xxx$1 ]"]; return filteredString; } diff --git a/Signal/test/util/OWSScrubbingLogFormatterTest.m b/Signal/test/util/OWSScrubbingLogFormatterTest.m index 9444a2e46..db9edb92e 100644 --- a/Signal/test/util/OWSScrubbingLogFormatterTest.m +++ b/Signal/test/util/OWSScrubbingLogFormatterTest.m @@ -1,5 +1,6 @@ -// Created by Michael Kirk on 9/27/16. -// Copyright © 2016 Open Whisper Systems. All rights reserved. +// +// Copyright (c) 2017 Open Whisper Systems. All rights reserved. +// #import "OWSScrubbingLogFormatter.h" #import @@ -36,11 +37,9 @@ NS_ASSUME_NONNULL_BEGIN for (NSString *phoneString in phoneStrings) { OWSScrubbingLogFormatter *formatter = [OWSScrubbingLogFormatter new]; - NSString *actual = [formatter - formatLogMessage:[self - messageWithString:[NSString stringWithFormat:@"My phone number is %@", phoneString]]]; - - NSRange redactedRange = [actual rangeOfString:@"My phone number is [ REDACTED_PHONE_NUMBER ]"]; + NSString *messageText = [NSString stringWithFormat:@"My phone number is %@", phoneString]; + NSString *actual = [formatter formatLogMessage:[self messageWithString:messageText]]; + NSRange redactedRange = [actual rangeOfString:@"My phone number is [ REDACTED_PHONE_NUMBER:xxx234 ]"]; XCTAssertNotEqual(NSNotFound, redactedRange.location, "Failed to redact phone string: %@", phoneString); NSRange phoneNumberRange = [actual rangeOfString:phoneString];