-
Notifications
You must be signed in to change notification settings - Fork 111
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Country code wrapped in brackets is not recognized #170
Comments
For me it works, see spec. |
Thanks for the fast response and your work! We can reproduce it when the The following test case fails:
it is passing when default_country_code is set to anything other than |
Hey @joost, I saw that the new version (v0.14.7) includes your spec for this issue. But as said, your spec does not cover our issue. The spec should be different:
Can you please change the spec? Thanks! |
What I expect:
What I get instead:
How is that possible?
The issue seems to be that
PhonyRails.normalize_number_default_country(…)
looks for a+
at the first position of the string. If that fails, it appends the default country code and checks if that is a valid number.Unfortunately:
+49 175…
is a valid german mobile prefix+49 491 …
is a valid german local prefixSuggested solution
Try to detect the
+
and thedefault_country_number
within the first characters, not at the first position only.The text was updated successfully, but these errors were encountered: