daddyz/phonelib

String inside number shows valid

Closed this issue · 1 comments

The command below evaluates to true;

Phonelib.valid_for_country? "91977947ada1801", :in

I don't think any country has this pattern of phone numbers.
This should be a general case failure.

@rajanverma-me Phonelib does sanitization prior to parsing, but you can enable strict check in initializer

Phonelib.valid_for_country?("91977947ada1801", :in) # => true 

Phonelib.strict_check = true
Phonelib.valid_for_country?("91977947ada1801", :in) # => false
Phonelib.valid_for_country?("919779471801", :in) # => true