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 2016-11-21 21:09:38 +01:00 committed by Moxie Marlinspike
parent 2ad2a95cc6
commit c2d8c9a662
1 changed files with 5 additions and 1 deletions

View File

@ -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) {