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:
parent
2ad2a95cc6
commit
c2d8c9a662
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue