Make sure the phone number consists of only digits#64
Make sure the phone number consists of only digits#64zsyed91 wants to merge 1 commit intopjf:masterfrom
Conversation
|
Oh gosh, phone numbers are tricky. '+' should definitely be allowed as a prefix, as that allows one to specify country. It's nice to be able to allow other human-friendly formatting characters like parentheses, spaces, or minus signs, although we can and probably should strip these as part of normalisation. So
You totally rock. I'd suggest your choice of Than you again for this! |
|
Awesome, thanks for the feedback. I will go ahead and implement the changes and add some tests. Should hopefully get some time this week to tackle this. |
|
Perhaps libphonenumber could be useful (live demo) |
|
I haven't forgotten about this, it will get done 😄 |
I saw this TODO and thought this would be straight forward to tackle. I was thinking of also adding a lower and upper bound in length. Researching phone number lengths made it seem like there is an international standard of 15 - 16 digits. We could increase this to maybe 20 as a catch all. What are your thoughts?
Valid formats as of now are only digits so
1234567or18005551234etc.Also, I did not see anywhere to add/update tests to check this code change. Any pointers regarding that, feels dirty not to have a test for this change 😄