Skip to content
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

Phonelib.parse Fails to Identify Country for Brazilian Numbers Without "+" Prefix #326

Closed
geraldaddey opened this issue Dec 10, 2024 · 1 comment

Comments

@geraldaddey
Copy link

geraldaddey commented Dec 10, 2024

Description

 
When parsing a Brazilian phone number without the + prefix, the Phonelib.parse method does not correctly identify the country. However, adding the + prefix works as expected.

require 'phonelib'

Phonelib.parse('554197520226').country

=> nil

Phonelib.parse('+554197520226').country

=> "BR"

Expected Behavior

The method should correctly identify the country as Brazil ("BR") regardless of whether the number is prefixed with +.

Actual Behavior

The method returns nil when the + prefix is omitted.

 

daddyz added a commit that referenced this issue Dec 16, 2024
daddyz added a commit that referenced this issue Dec 16, 2024
@daddyz
Copy link
Owner

daddyz commented Dec 16, 2024

@geraldaddey fixed in 0.10.3

@daddyz daddyz closed this as completed Dec 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants