Further restrict E164 format in storage service
This commit is contained in:
parent
3d735acdec
commit
260c1fd9df
1 changed files with 1 additions and 1 deletions
|
@ -28,7 +28,7 @@ export function validateConversation(
|
||||||
function validateNumber(attributes: ValidateConversationType): string | null {
|
function validateNumber(attributes: ValidateConversationType): string | null {
|
||||||
const { e164 } = attributes;
|
const { e164 } = attributes;
|
||||||
if (isDirectConversation(attributes) && e164) {
|
if (isDirectConversation(attributes) && e164) {
|
||||||
if (!/^\+[0-9]{1,19}$/.test(e164)) {
|
if (!/^\+[1-9][0-9]{0,18}$/.test(e164)) {
|
||||||
return 'Invalid E164';
|
return 'Invalid E164';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue