Make E164 log scrubber redact numbers of length >= 7.

This commit is contained in:
Oscar Mira
2019-08-07 15:31:08 +02:00
committed by Alan Evans
parent d0ce4ff032
commit 110a40592b
2 changed files with 6 additions and 5 deletions

View File

@@ -32,9 +32,10 @@ public final class Scrubber {
/**
* The middle group will be censored.
* Supposedly, the shortest international phone numbers in use contain seven digits.
* Handles URL encoded +, %2B
*/
private static final Pattern E164_PATTERN = Pattern.compile("(\\+|%2B)(\\d{8,13})(\\d{2})");
private static final Pattern E164_PATTERN = Pattern.compile("(\\+|%2B)(\\d{5,13})(\\d{2})");
private static final String E164_CENSOR = "*************";
/**