masked value should not be cached since it might include references

This commit is contained in:
michael starke
2017-11-08 13:23:06 +01:00
parent c8bc829600
commit b20631da6e

View File

@@ -26,7 +26,6 @@
@interface MPAutotypeContext () {
NSString *_evaluatedCommand;
NSString *_maskedEvaluatedCommand;
}
@end
@@ -71,13 +70,10 @@
}
- (NSString *)maskedEvaluatedCommand {
if(!_maskedEvaluatedCommand) {
NSString *passwordPlaceholder = [NSString stringWithFormat:@"{%@}",kKPKPasswordKey];
NSString *normalized = self.normalizedCommand;
NSString *masked = [normalized stringByReplacingOccurrencesOfString:passwordPlaceholder withString:@"•••••" options:NSCaseInsensitiveSearch range:NSMakeRange(0, normalized.length)];
_maskedEvaluatedCommand = [[masked kpk_finalValueForEntry:self.entry] copy];
}
return _maskedEvaluatedCommand;
NSString *passwordPlaceholder = [NSString stringWithFormat:@"{%@}",kKPKPasswordKey];
NSString *normalized = self.normalizedCommand;
NSString *masked = [normalized stringByReplacingOccurrencesOfString:passwordPlaceholder withString:@"•••" options:NSCaseInsensitiveSearch range:NSMakeRange(0, normalized.length)];
return [[masked kpk_finalValueForEntry:self.entry] copy];
}
- (NSString *)description {