Faroese phone numbers are 6 digits in length and has

a 3-digit dialing code, but the validation regex
 requires 10-digit numbers.

Validates numbers the same way libsignal-service-java does it.

Closes #72
This commit is contained in:
Mikkel Kroman authored and Moxie Marlinspike committed 2017-01-10 11:19:12 -08:00
1 parent 2ad2a95cc6
commit c2d8c9a662
1 file changed
+5 -1
@@ -43,7 +43,11 @@ public class Util {
}
public static boolean isValidNumber(String number) {
return number.matches("^\\+[0-9]{10,}");
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}");
}
public static String encodeFormParams(Map<String, String> params) {