Uh oh!
There was an error while loading. Please reload this page.
Enabled mobile phone validation - #339
Conversation
coveralls
commented
Dec 18, 2014
coveralls
commented
Dec 18, 2014
coveralls
commented
Dec 18, 2014
coveralls
commented
Dec 18, 2014
There was a problem hiding this comment.
Can you change it slightly so that it doesn't set a default locale and also throws an error if the locale is unknown? Something like:
if(localeinphones){returnphones[locale].test(str);}thrownewError('Unknown phone locale: '+locale);There was a problem hiding this comment.
Thank you for the advice and nice code suggestion.
As i don't see any previous exceptions thrown in your code, i would like to have your confirmation that we really throw an exception or we just return a false value?
thanks.
There was a problem hiding this comment.
Good point, a return false; is fine then I suppose.
There was a problem hiding this comment.
Updated.
Please advice.
Thanks.
coveralls
commented
Dec 18, 2014
chriso
commented
Dec 18, 2014
Thanks. Available as of |
ItalyPaleAle
commented
Jan 12, 2015
@chriso does this mean you'll accept PR for all phone-number related patches? |
chriso
commented
Jan 13, 2015
Sure :) As long as it follows the same general pattern of |
ItalyPaleAle
commented
Jan 14, 2015
Have you taken a look at https://github.com/googlei18n/libphonenumber ? Their metadata library is probably the best open source currently available. |
Enabled mobile phone (China) validation