From 27042dae4db38457854f0ad9dd2ba269403e8e4e Mon Sep 17 00:00:00 2001 From: Moxie Marlinspike Date: Mon, 29 Oct 2018 07:05:23 -0700 Subject: [PATCH] Update valid phone number ranges Closes #86 --- .../org/whispersystems/textsecuregcm/util/Util.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/main/java/org/whispersystems/textsecuregcm/util/Util.java b/src/main/java/org/whispersystems/textsecuregcm/util/Util.java index 5d4e60afc..48215f2b3 100644 --- a/src/main/java/org/whispersystems/textsecuregcm/util/Util.java +++ b/src/main/java/org/whispersystems/textsecuregcm/util/Util.java @@ -45,10 +45,14 @@ public class Util { public static boolean isValidNumber(String number) { return number.matches("^\\+[0-9]{10,}") || - number.matches("^\\+298[0-9]{6}") || - number.matches("^\\+240[0-9]{6}") || - number.matches("^\\+687[0-9]{6}") || - number.matches("^\\+689[0-9]{6}"); + number.matches("^\\+240[0-9]{6}") || // Equatorial Guinea + number.matches("^\\+298[0-9]{6}") || // Faroe Islands + number.matches("^\\+299[0-9]{6}") || // Greenland + number.matches("^\\+376[0-9]{6}") || // Andorra + number.matches("^\\+597[0-9]{6}") || // Suriname + number.matches("^\\+685[0-9]{5}") || // Samoa + number.matches("^\\+687[0-9]{6}") || // New Caledonia + number.matches("^\\+689[0-9]{6}"); // French Polynesia } public static String encodeFormParams(Map params) {